Here’s how to use date() function.
Description:
Get the date part of the datetime value.
Syntax:
date(datetimeExp)
Note:
The function gets the date part of the datetimeExp.
Parameter:
datetimeExp |
Datetime value. |
Return value:
Date
Example:
date(now()) |
2013-12-09 |
Related function:
Description:
Convert a string, an integer or a long integer to a date value.
Syntax:
Note:
The function converts string stringExp or integer year, month, day to date type data.
Parameter:
format |
Format string. |
stringExp |
String expression. |
loc |
Language name, which is case insensitive. The most commonly used languages are Chinese (zh) and English (en); see A.sort() to know other languages supported in esProc. |
year |
An integer. |
month |
An integer. |
day |
An integer. |
ym |
An integer, which is interpreted as year and month when it is a 6-bit one and where 20 is added at the beginning when it is a 4-bit one. |
ymd |
An 8-bit or 6-bit integer where month and day take up two bits respectively and year occupies two or four bits. |
Return value:
Date
Example:
|
A |
|
1 |
=date("1982-08-09") |
1982-08-09 |
2 |
=date("1982-08-09 10:20:30") |
1982-08-09 |
3 |
=date(1982,08,09) |
1982-08-09 |
4 |
=date(1982,-8,09) |
1981-04-09 |
5 |
=date(1982,18,09) |
6/9/1983 |
6 |
=date("12/28/1972"," MM/dd/yyyy ") |
1972-12-28 |
7 |
=date(189208,08) |
1892-08-08 |
8 |
=date("4 Jul 2001","d MMM yyyy":"en") |
2001-07-04 |
9 |
=date@o(150) |
1970-05-22 |
10 |
=date(2504,08) |
2025-04-08 |
11 |
=date(20250408) |
2025-04-08 |
12 |
=date(250408) |
2025-04-08 |
Related function:
Description:
Return the time and date of a file last modified.
Syntax:
f.date()
Note:
The function returns the time and date of file f last modified.
Parameter:
f |
File object. |
Return value:
Datetime data
Example:
|
A |
|
1 |
=file("D://p1.splx").date() |
"2013-05-02 09:45:08" |
Related function: