1,501
edits
No edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
Just as a reminder, the following Date reserved words are often used in working with dates: | Just as a reminder, the following Date reserved words are often used in working with dates: | ||
* <code><b>[[Date]]</ | * <code><b>[[Date]]</b></code>, which returns the Date of the current bar in ''YYYMMdd'' format. This date format is always the format with which a date calculation starts. | ||
* <code><b>[[CurrentDate]]</ | * <code><b>[[CurrentDate]]</b></code>, returns the current computer date in ''YYYMMdd'' format. | ||
* <code><b>[[ELDateToDateTime]]</ | * <code><b>[[ELDateToDateTime]]</b></code>, converts a date in ''YYmmdd'' format to a date into DateTime format. | ||
See the [[:Category:Date_and_Time_Routines|Date & Time Routines]] for all EasyLanguage reserved words. | See the [[:Category:Date_and_Time_Routines|Date & Time Routines]] for all EasyLanguage reserved words. | ||
Line 19: | Line 19: | ||
Which returns the following sentence: ''The current date is: 1120127.00''. | Which returns the following sentence: ''The current date is: 1120127.00''. | ||
To output the date in a more readable format, the reserved word <code><b>[[FormatDate]]</ | To output the date in a more readable format, the reserved word <code><b>[[FormatDate]]</b></code> is needed. However, FormatDate requires that the date is in DateTime format, while the default Date is in YYYMMdd format. So, a conversion to DateTime is needed first. This is done with the <code><b>[[ELDateToDateTime]]</b></code> reserved word. | ||
The code example below shows in detail which steps needs to be made. | The code example below shows in detail which steps needs to be made. | ||
Line 59: | Line 59: | ||
== Outputting the date in different formats == | == Outputting the date in different formats == | ||
The <code><b>[[FormatDate]]</ | The <code><b>[[FormatDate]]</b></code> reserved word has a parameter string by which different date outputs can be generated. For example, in the code above we used "dd-MM-yyyy" to return "27-1-2012". | ||
The code example below shows some of these parameter options for FormatDate (see the <code><b>[[FormatDate]]</ | The code example below shows some of these parameter options for FormatDate (see the <code><b>[[FormatDate]]</b></code> article for an extensive list of parameter options). | ||
<syntaxhighlight> | <syntaxhighlight> |