Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - 日本語 - Русский
Ajuda do Scilab >> Data e Hora > clock

clock

Return the current Gregorian datetime and international time zone of the computer's clock

Syntax

[datetime, timezone, Dst] = clock()

Arguments

datetime
[year, month, day, hour, minute, second] vector. The first five elements are integers. The second element is accurate up to the millisecond.

timezone
A scalar multiple of 0.25 in [-12, 12]. Most of geographical areas have an integer time zone. A few are on a half-an-hour or even a quarter time zone. timezone < 0 for Brasil, and > 0 for France, Russia, and Japan, etc.

Dst
0 or 1: Daylight saving time. 1 if the time area of the computer is registered to apply a Daylight saving time offset, and currently applies it ; 0 otherwise.

Description

clock() returns the current state of the clock of the computer. This clock is registered for a given time zone and area, and provides the local legal time.

The time zone of the computer can also be retrieved through the computer's OS. However, when a Daylight saving time offset applies, the returned time zone may include it.

Examples

[datetime, tz, Dst] = clock()
--> [datetime, tz, Dst] = clock()
 datetime  =
   2020.   7.   23.   21.   26.   36.979

 tz  =
   1.

 Dst  =
   1.

More information, on Windows:

powershell("Get-Timezone")(3:8)
--> powershell("Get-Timezone")(3:8)
 ans  =
  "Id                         : Romance Standard Time"
  "DisplayName                : (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris"
  "StandardName               : Paris, Madrid"
  "DaylightName               : Paris, Madrid (heure d'été)"
  "BaseUtcOffset              : 01:00:00"
  "SupportsDaylightSavingTime : True"

See also

  • getdate — Current datetime or POSIX timestamp from computer's clock. Datetimes from given timestamps
  • datevec — Date components
  • datenum — Convert to serial date number
  • calendar — Calendar of a given month and year (Gregorian dates)

History

VersãoDescrição
6.1.1 Time zone and Daylight saving time outputs added.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:35:27 CET 2022