Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

now

Current date and time as serial date number

Syntax

t = now

Description

t = now returns the current date and time as a serial date number. A serial date number represents the whole and fractional number of days from a fixed, preset date (January 0, 0000).

floor(now) returns the current date as a serial date number, and rem(now,1) returns the current time as a serial date number. datestr(now) returns the current date and time as text.

Examples

t1 = now, t2 = rem(now,1)

t1 =

   7.2908e+05


t2 =

    0.4013

More About

collapse all

Tips

  • To return a datetime scalar representing the current date and time, type:

    t = datetime('now')

Introduced before R2006a

Was this topic helpful?