EasyLanguage Object Reference
Defines the structure for an object that provides information about the system date and time.
Namespace: elsystem
| Name | Type | Description | |
|
|
CurrentTime | object | Gets current time of day only. |
|
|
Day | integer | Gets and sets the day portion of the object's date. |
|
|
ELDate | integer | Gets and sets the date in legacy EasyLanguage format (YYYMMDD, where YYY is years since 1900, MM is the month, and DD is the day of the month). |
|
|
ELDateTimeEx | double | Gets and sets the date and time in legacy EasyLanguage format. |
|
|
ELTime | integer | Gets and sets the time in legacy EasyLanguage format (HHMM, where HH is the hours since midnight and MM is the minutes within the hour). |
|
|
Hour | integer | Gets and sets the hour portion of the time. |
|
|
Minute | integer | Gets and sets the minute portion of the object's time. |
|
|
Month | integer | Gets and sets the month portion of the object's date. |
|
|
Now | object | Gets the current date and time of object's day. |
|
|
Second | integer | Gets and sets the seconds portion of the object's time. |
|
|
Today | object | Gets the current date only. |
|
|
Value | string | Gets and sets the current date and time as a string. Equivalent to ToString() when getting a date/time and Parse() when setting a date/time. |
|
|
Year | integer | Gets and sets the year portion of the object's date. |
| Name | Description | |
|
|
Create | Initializes an instance of the DateTime class. |
|
|
Create(y,m,d,h,m,s) | Initializes an instance of DateTime with the specified year, month, day, hour, minute, and seconds parameters. |
|
|
Create(y,m,d) | Initializes an instance of DateTime with the specified year, month, and day. |
|
|
ELFormatDate(format) | Converts the DateTime value to a string using EL format codes "ddd MMM dd yy" (see FormatDate reserved word). |
|
|
ELFormatTime(format) | Converts the DateTime value to a string using EL format codes "hh:mm:ss tt" (see FormatTime reserved word). |
|
|
Equals(obj) | True if Obj is equal to the current instance, otherwise False. |
|
|
Format(format) | Converts the DateTime value to a string using % format codes (see below). |
|
|
FromELDateAndTime(ElDate,ELTime) | Converts legacy EL date and EL time values to a DateTime equivalent. |
|
|
Parse(string) | Converts the date and time string parameter to a DateTime equivalent. |
|
|
SetToCurrentTime() | Sets the DateTime value to the current date and time. |
|
|
ToString() | Converts the DateTime value to a string. |
|
|
TryParse(string,result) | True if date and time string will convert successfully to the result DateTime. |
| Name | Description | |
|
|
operator+ | Adds a specified TimeSpan to a specified DateTime, yielding a new date and time. |
|
|
operator+= | Adds a specified TimeSpan to the current DateTime instance, yielding a new date and time. |
|
|
operator- | Subtracts a specified TimeSpan from a specified DateTime, yielding a new date and time. |
|
|
operator-= | Subtracts a specified TimeSpan from the current DateTime instance, yielding a new date and time. |
|
|
operator< | True when one specified DateTime is less than another specified DateTime. |
|
|
operator<= | True when one specified DateTime is equal to or less than another specified DateTime. |
|
|
operator> | True when one specified DateTime is greater than another specified DateTime. |
|
|
operator>= | True when one specified DateTime is greater than or equal to another specified DateTime. |
The argument of the Format method consists of string including formatting codes that are preceded by a percent sign (%). Characters that do not begin with % are copied unchanged to destination string.
For example, to plot a formatted date using the abbreviated weekday, name of month, date, and full year:
Plot1(elsystem.Datetime.Today.Format("%a %b %d, %Y")); // Wed May 05, 2010
or to plot the 12-hour time with AM/PM indication:
Plot2(elsystem.Datetime.CurrentTime.Format("%I:%M:%S, %p")); // 01:22:14 PM
or to plot a formatted date and time:
Plot3(elsystem.Datetime.Now.Format("%m-%d-%y %H:%M")); // 05-05-10 13:22
The formatting codes are listed below:
| Code | Description |
| %a | Abbreviated weekday name |
| %A | Full weekday name |
| %b | Abbreviated month name |
| %B | Full month name |
| %c | Date and time representation appropriate for locale |
| %d | Day of month as decimal number (01 - 31) |
| %H | Hour in 24-hour format (00 - 23) |
| %I | Hour in 12-hour format (01 - 12) |
| %j | Day of year as decimal number (001 - 366) |
| %m | Month as decimal number (01 - 12) |
| %M | Minute as decimal number (00 - 59) |
| %p |
Current locale's A.M./P.M. indicator for 12-hour clock |
| %S | Second as decimal number (00 - 59) |
| %U | Week of year as decimal number, with Sunday as first day of week (00 - 53) |
| %w | Weekday as decimal number (0 - 6; Sunday is 0) |
| %W | Week of year as decimal number, with Monday as first day of week (00 - 53) |
| %x | Date representation for current locale |
| %X | Time representation for current locale |
| %y | Year without century, as decimal number (00 - 99) |
| %Y | Year with century, as decimal number |
| %z, %Z | Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown |
| %% | Percent sign |
elsystem.DateTime