date()

Read(221) Label: date,

Here’s how to use date() function.

date( datetimeExp )

Description:

Get the date part of the datetime value.

Syntax:  

date(datetimeExp)

Note:  

The function gets the date part of the datetimeExp.

Parameters:  

datetimeExp

Datetime value

Return value:  

Date type data

Example:

date(now())

2013-12-09

Related functions:

date()

datetime(datetimeExp)

time(datetimeExp)

datetime()

time()

date()

Description:

Convert a string or an integer to a date value.

Syntax:

date(stringExp,format)

Convert stringExp to a date value according to the format defined by format

date(stringExp)

The format of the result returned by stringExp should be in consistent with the date format in configuration information; if time is contained in the result, the time will not be converted

date(year,month,day)

Convert year,month,day of integer type to date type

date(ym,day)

Convert integer ym and day into date data

Note:

The function converts string stringExp or integer year,month,day to date type data.

Parameters:

format

Format string

stringExp

String expression

year

Integer

month

Integer

day

Integer

ym

6-bit integer interpreted as year and month

Return value:

Date type data

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

Related functions:

date(datetimeExp)

datetime(datetimeExp)

time(datetimeExp)

datetime()

time()

f .date()

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.dfx").date()

"2013-05-02 09:45:08"

Related functions:

f. exists()

f. size()

movefile()