Table of contents
  1. 1. Usage Restrictions
  2. 2. Parameters
  3. 3. Result
  4. 4. Samples
date.ChangeTimezone(dateime : str, timezone : str?) : str

Change time-zone of date-time.

Usage Restrictions

9.02 or later.

Parameters

Name Type Description
datetime str date time string
timezone str? time-zone offset (format: ±hh:mm, optional, default: GMT)

Result

A new datetime string adjusted for the given timezone

Samples

  Output

To display the timezone of the current datetime object:

date.now;
<br/>date.ChangeTimezone(date.now, "+05:00"); 
Thu, 11 Mar 2010 19:32:59 GMT
Fri, 12 Mar 2010 00:32:59 +05:00

 

 

Tag page (Edit tags)
    Viewing 2 of 2 comments: view all
    Why would this function return the GMT string once its been adjusted...
    Posted 20:05, 21 Apr 2009
    The sample was a bit unfortunate. I updated it to be more clear. Thanks for bringing it up! edited 03:42, 22 Apr 2009
    Posted 03:33, 22 Apr 2009
    Viewing 2 of 2 comments: view all
    You must login to post a comment.