DateTime2Clock

This function calculates how many seconds have elapsed since 12:00 AM GMT on January 1, 1970, given a specified date and time.

Function Group Execution Windows Embedded Thin Client Mobile Access
DateTime2Clock Date & Time Synchronous Supported Supported Supported Supported (see “Notes” below)

Syntax

  DateTime2Clock( strDate, strTime, optTimeZone )  
Web Studio Help ion datetime datetime2clock.xml d90713e88 DateTime2Clock

strDate
The date to be used in the calculation, formatted as MM/DD/YYYY.
strTime
The time to be used in the calculation, formatted as HH:MM:SS.
optTimeZone
A time zone name (string) or index (integer).
Value Description
-i A time zone index (i), up to the maximum index returned by the function GetTimeZoneCount.

On Windows Embedded Compact, the only valid index is -1 (i.e., the current time zone).

0 The current time zone in either the project runtime or the Viewer module / thin client, depending on where the function is called from.

This may be different from the current time zone in the local computer’s system settings, if the function SetTimeZone was executed previously.

1 Coordinated Universal Time (UTC).
2 The current time zone in the local computer’s system settings.

On Windows Embedded Compact, this value is invalid.

"timezone" The full name of a time zone (e.g., "Central Standard Time").

On Windows Embedded Compact, this value is invalid.

This parameter is optional; if you do not specify a tag or value, then the default value is 0.

Returned value

This function returns the number of seconds that have elapsed since 12:00 AM GMT on January 1, 1970, given the specified date and time. If a time zone is specified, then the number of seconds is adjusted to reflect the change from the current time zone to the specified time zone.

Notes

If this function is called on Mobile Access, it is executed using the system time on the project runtime server.

Examples

Get the number of seconds elapsed when the system clock started counting:
  DateTime2Clock("01/01/1970","00:00:00","Greenwich Mean Time")  
Get the number of seconds elapsed at 10:59:19 AM on April 15, 2002, in the current time zone:
  DateTime2Clock("04/15/2002","10:59:19")  

DateTime2Clock