Error processing SSI file
Error processing SSI file

Home » Development Area » DigiGuide Listings Grabber » API Index » Class: TimeZone » convertToUTC Method

Class TimeZone : convertToUTC Method


Date convertToUTC( Integer year, Integer month, Integer day, Integer hour, Integer minute, [ Integer second ] )

Summary

Converts given 'localised' date parameters to a UTC date object


Remarks

Converts from localised date information as declared on object construction of via the set method to a UTC date object.


Parameters

ParameterDescription
Integer year Specify a 4 digit year value
Integer month Specify a month indexed from 1. January = 1, December = 12
Integer day Specify a day of the month.
Integer hour Specify an hour value
Integer minute Specify a minutes value
Integer second [optional] Specify an optional seconds value (if not specified, 0 is assumed)


Returns

Returns a standard Date object


Examples

var date = new String( "19/09/2007" );
var arrDate = date.split( "/" );

var time = new String( "21:00" );
var arrTime = time.split( ":" );


var tz = new TimeZone( "BST" );
newDate = tz.convertToUTC( arrDate[ 2 ], arrDate[ 1 ], arrDate[ 0 ], arrTime[ 0 ], arrTime[ 1 ] );
debugOut( "Converted " + tz.name + " (" + tz.code + ") date: " + date + " " + time + " to GMT " + newDate.toUTCString() );


See Also

  • TimeZone : set

    (Last updated: September 25, 2007 11:27:08)

    Error processing SSI file