Euphoria Ticket #758: Enable the datetime module to do UTC - Local time conversions

Add the following functions to datetime.e module:

  • local_to_utc( datetime x, object tz=CURRENT_TMZ)
  • utc_to_local( datetime x, object tz=CURRENT_TMZ)
  • get_timezone()

local_to_utc

This takes a datetime x which represents a local time and returns the same time converted to Coordinated Universal Time - (the old GMT). It optionally takes a time zone difference for the local time. If this is omitted, the timezone set by the operating system is used.

utc_to_local

This takes a datetime x which represents the UTC time and returns the same time converted to a local time. It optionally takes a time zone difference for the local time. If this is omitted, the timezone set by the operating system is used.

get_timezone

This returns the number of hours (an atom) difference between the computer's clock and UTC.

Details

Type: Feature Request Severity: Normal Category: Library Routine
Assigned To: DerekParnell Status: New Reported Release:
Fixed in SVN #: View VCS: none Milestone:

1. Comment by DerekParnell Mar 26, 2012

I've also noticed many useful local routines that could be made public with the addition of some documentation.

Search



Quick Links

User menu

Not signed in.

Misc Menu