Difference between revisions of "DateToString"

From MultiCharts
Jump to navigation Jump to search
m (Reverted edits by 176.8.90.7 (talk) to last revision by 194.84.116.138)
Line 3: Line 3:
 
The integer portion of the DateTime value specifies the number of days since January 1st, 1900, and the fractional portion of the DateTime value specifies the fraction of the day since midnight.  
 
The integer portion of the DateTime value specifies the number of days since January 1st, 1900, and the fractional portion of the DateTime value specifies the fraction of the day since midnight.  
 
   
 
   
==== Usage ====
+
== Usage ==
 
<syntaxhighlight>DateToString(DateTime)</syntaxhighlight>  
 
<syntaxhighlight>DateToString(DateTime)</syntaxhighlight>  
  
Where: [[DateTime]] - a double-precision decimal DateTime value to be converted to a string expression representing the date  
+
Where:  
 +
 
 +
:'''DateTime''' - a double-precision decimal DateTime value to be converted to a string expression representing the date.
 
   
 
   
==== Notes ====  
+
== Notes ==
The output example is in the default US regional date format. Date format is controlled by the Regional Options settings that can be accessed from the Control Panel of the Windows XP operating system.  
+
* The output in the examples below is in the default regional date format of the user. Date format is controlled by the Regional Options settings that can be accessed from the Control Panel of the Windows operating system. Depending on your regional settings your output might differ from the examples below.
 
   
 
   
==== Example ====
+
== Examples ==
<syntaxhighlight>DateToString(39448.25000000) will return the string "1/1/2008".</syntaxhighlight>
+
<syntaxhighlight>DateToString(39448.25000000)</syntaxhighlight>
 +
Will return the string "1/1/2008".
  
 
+
<syntaxhighlight>DateToString(ComputerDateTime)</syntaxhighlight>
+
Will return the string "19-2-2012" for someone with European Regional settings.
  
 
[[Category:Date and Time Routines]]
 
[[Category:Date and Time Routines]]

Revision as of 12:37, 19 February 2012

Returns a string expression corresponding to the date (integer) portion of the specified DateTime value.

The integer portion of the DateTime value specifies the number of days since January 1st, 1900, and the fractional portion of the DateTime value specifies the fraction of the day since midnight.

Usage

DateToString(DateTime)

Where:

DateTime - a double-precision decimal DateTime value to be converted to a string expression representing the date.

Notes

  • The output in the examples below is in the default regional date format of the user. Date format is controlled by the Regional Options settings that can be accessed from the Control Panel of the Windows operating system. Depending on your regional settings your output might differ from the examples below.

Examples

DateToString(39448.25000000)

Will return the string "1/1/2008".

DateToString(ComputerDateTime)

Will return the string "19-2-2012" for someone with European Regional settings.