Storing and Presenting DateTimes
- Always, always, always store datetimes in UTC
- this makes your life easier
- For presentation, use the viewer's local time zone
my $dt = get_datetime_from_database(); $dt->set_time_zone( $user->time_zone ); print $dt->datetime;
- Makes it easy to do calculations on your stored datetimes
- do appointments overlap?
- how long is a meeting?
- how many days vacation?