date

date — Returns the number seconds since a base date.

Description

Returns the number seconds since a base date, using the operating system's clock. The base is 1 January 1970 for Csound using doubles, and 1 January 2010 for versions using floats.

Syntax

ir date

Initialization

ir -- value at i-time, of the system clock in seconds since the start of the epoch.

Note that the base date was originally 1970 but since verson 5.14 it has been changed as single precission floating point numbers are insufficient to indicate changes.

Examples

Here is an example of the date opcode. It uses the file date.csd.

Example 167. Example of the date opcode.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o date.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
instr 1
      ii date
      print ii
      Sa dates ii
      prints Sa
      Ss dates -1
      prints Ss
      St dates 1
      prints St 
endin

</CsInstruments>
<CsScore>
i 1 0 1
e
</CsScore>
</CsoundSynthesizer>


Its output should include lines like this:

instr 1:  ii = 1165665152.000
Sat Dec  9 11:52:32 2006
Sat Dec  9 11:51:46 2006
Thu Jan  1 01:00:01 1970
      

See Also

dates

Credits

Author: John ffitch
University of Bath/Codemist Ltd.
Bath, UK
December 2006

New in Csound version 5.05

Changed in Csound version 5.14