150 lines
18 KiB
HTML
150 lines
18 KiB
HTML
|
<!doctype html><html lang='en'><head><title>Date | SuperCollider 3.10.2 Help</title>
|
|||
|
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
|
|||
|
<link rel='stylesheet' href='./../codemirror.css' type='text/css' />
|
|||
|
<link rel='stylesheet' href='./../editor.css' type='text/css' />
|
|||
|
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
|
|||
|
<link rel='stylesheet' href='./../custom.css' type='text/css' />
|
|||
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
|||
|
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
|
|||
|
<script src='./../lib/jquery.min.js'></script>
|
|||
|
<script src='./../lib/codemirror-5.39.2.min.js' type='text/javascript'></script>
|
|||
|
<script src='./../lib/codemirror-addon-simple-5.39.2.min.js' type='text/javascript'></script>
|
|||
|
<script>
|
|||
|
var helpRoot = './..';
|
|||
|
var scdoc_title = 'Date';
|
|||
|
var scdoc_sc_version = '3.10.2';
|
|||
|
</script>
|
|||
|
<script src='./../scdoc.js' type='text/javascript'></script>
|
|||
|
<script src='./../docmap.js' type='text/javascript'></script>
|
|||
|
<script src='qrc:///qtwebchannel/qwebchannel.js' type='text/javascript'></script>
|
|||
|
</head>
|
|||
|
<body onload='fixTOC()'>
|
|||
|
<div id='toc'>
|
|||
|
<div id='toctitle'>Date:</div>
|
|||
|
<span class='toc_search'>Filter: <input id='toc_search'></span><ul class='toc'><li class='toc1'><a href='#classmethods'>Class methods</a></li>
|
|||
|
<ul class='toc'><li class='toc3'><a href='#*new'>new</a> </li>
|
|||
|
<li class='toc3'><a href='#*getDate'>getDate</a> </li>
|
|||
|
<li class='toc3'><a href='#*localtime'>localtime</a> </li>
|
|||
|
<li class='toc3'><a href='#*gmtime'>gmtime</a> </li>
|
|||
|
<li class='toc3'><a href='#*seed'>seed</a> </li>
|
|||
|
<li class='toc2'><a href='#Inherited%20class%20methods'>Inherited class methods</a></li>
|
|||
|
<li class='toc2'><a href='#Undocumented%20class%20methods'>Undocumented class methods</a></li>
|
|||
|
<ul class='toc'><li class='toc3'><a href='#*fromRawSeconds'>fromRawSeconds</a> </li>
|
|||
|
<li class='toc3'><a href='#*fromSMPTE'>fromSMPTE</a> </li>
|
|||
|
</ul></ul><li class='toc1'><a href='#instancemethods'>Instance methods</a></li>
|
|||
|
<ul class='toc'><li class='toc3'><a href='#-localtime'>localtime</a> </li>
|
|||
|
<li class='toc3'><a href='#-gmtime'>gmtime</a> </li>
|
|||
|
<li class='toc3'><a href='#-dayStamp'>dayStamp</a> </li>
|
|||
|
<li class='toc3'><a href='#-hourStamp'>hourStamp</a> </li>
|
|||
|
<li class='toc3'><a href='#-secStamp'>secStamp</a> </li>
|
|||
|
<li class='toc3'><a href='#-stamp'>stamp</a> </li>
|
|||
|
<li class='toc3'><a href='#-asSortableString'>asSortableString</a> </li>
|
|||
|
<li class='toc3'><a href='#-asctime'>asctime</a> </li>
|
|||
|
<li class='toc3'><a href='#-asString'>asString</a> </li>
|
|||
|
<li class='toc3'><a href='#-format'>format</a> </li>
|
|||
|
<li class='toc2'><a href='#Inherited%20instance%20methods'>Inherited instance methods</a></li>
|
|||
|
<li class='toc2'><a href='#Undocumented%20instance%20methods'>Undocumented instance methods</a></li>
|
|||
|
<ul class='toc'><li class='toc3'><a href='#-asSMPTE'>asSMPTE</a> </li>
|
|||
|
<li class='toc3'><a href='#-day'>day</a> </li>
|
|||
|
<li class='toc3'><a href='#-dayOfWeek'>dayOfWeek</a> </li>
|
|||
|
<li class='toc3'><a href='#-hour'>hour</a> </li>
|
|||
|
<li class='toc3'><a href='#-minute'>minute</a> </li>
|
|||
|
<li class='toc3'><a href='#-month'>month</a> </li>
|
|||
|
<li class='toc3'><a href='#-rawSeconds'>rawSeconds</a> </li>
|
|||
|
<li class='toc3'><a href='#-schedBundle'>schedBundle</a> </li>
|
|||
|
<li class='toc3'><a href='#-second'>second</a> </li>
|
|||
|
<li class='toc3'><a href='#-year'>year</a> </li>
|
|||
|
</ul></ul></ul></div><div id='menubar'></div>
|
|||
|
<div class='contents'>
|
|||
|
<div class='header'>
|
|||
|
<div id='label'>
|
|||
|
<span id='folder'>Classes</span>
|
|||
|
| <span id='categories'><a href='./../Browse.html#Control'>Control</a></span>
|
|||
|
</div><h1>Date<span id='superclasses'> : <a href="../Classes/Object.html">Object</a></span>
|
|||
|
</h1>
|
|||
|
<div id='summary'>an object describing a point in time</div>
|
|||
|
</div>
|
|||
|
<div class='subheader'>
|
|||
|
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Math/Date.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Math/Date.sc'>Date.sc</a></div></div>
|
|||
|
<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*new' href='./../Overviews/Methods.html#new'>new</a>(<span class='argstr'>year</span>, <span class='argstr'>month</span>, <span class='argstr'>day</span>, <span class='argstr'>hour</span>, <span class='argstr'>minute</span>, <span class='argstr'>second</span>, <span class='argstr'>dayOfWeek</span>, <span class='argstr'>rawSeconds</span>)</h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Create a new date with the given properties (all numerical values). These arguments are also the names of instance variables of the date object.</div><h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*getDate' href='./../Overviews/Methods.html#getDate'>getDate</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Get current date from system and create a date object from it.<textarea class='editor'>(
|
|||
|
var a = Date.getDate;
|
|||
|
a.rawSeconds.postln;
|
|||
|
a.dayOfWeek.postln;
|
|||
|
a
|
|||
|
)</textarea>
|
|||
|
</div><h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*localtime' href='./../Overviews/Methods.html#localtime'>localtime</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Get current localized time from system and create a date object from it.</div><h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*gmtime' href='./../Overviews/Methods.html#gmtime'>gmtime</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Get current <strong>Greenwich Mean Time (GMT)</strong> from system and create a date object from it.</div><h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*seed' href='./../Overviews/Methods.html#seed'>seed</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Get current date and return a value suitable for seeding a random number generator. See also <a href="./../Reference/randomSeed.html">randomSeed</a>.<textarea class='editor'>(
|
|||
|
var a = Date.seed;
|
|||
|
thisThread.randSeed = a;
|
|||
|
20.do { [1,0].choose.post }; "".postln;
|
|||
|
thisThread.randSeed = a;
|
|||
|
25.do { [1,0].choose.post }; "".postln;
|
|||
|
)</textarea>
|
|||
|
</div><h3><a class='anchor' name='Inherited%20class%20methods'>Inherited class methods</a></h3>
|
|||
|
<div id='inheritedclassmets'></div><h3><a class='anchor' name='Undocumented%20class%20methods'>Undocumented class methods</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*fromRawSeconds' href='./../Overviews/Methods.html#fromRawSeconds'>fromRawSeconds</a>(<span class='argstr'>rawSeconds: 0</span>, <span class='argstr'>daylightSavings: 1</span>)</h3>
|
|||
|
<div class='extmethod'>From extension in <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/wslib/wslib-classes/Main Features/SMPTE/extDate-fromSMPTE.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/wslib/wslib-classes/Main Features/SMPTE/extDate-fromSMPTE.sc</a></div>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>Date.</span><a class='method-name' name='*fromSMPTE' href='./../Overviews/Methods.html#fromSMPTE'>fromSMPTE</a>(<span class='argstr'>smpte</span>, <span class='argstr'>daylightSavings: 1</span>)</h3>
|
|||
|
<div class='extmethod'>From extension in <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/wslib/wslib-classes/Main Features/SMPTE/extDate-fromSMPTE.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/wslib/wslib-classes/Main Features/SMPTE/extDate-fromSMPTE.sc</a></div>
|
|||
|
<h2><a class='anchor' name='instancemethods'>Instance Methods</a></h2>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-localtime' href='./../Overviews/Methods.html#localtime'>localtime</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Set the receiver's time to current localtime.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-gmtime' href='./../Overviews/Methods.html#gmtime'>gmtime</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Set the receiver's time to current <strong>Greenwich Mean Time (GMT)</strong>.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-dayStamp' href='./../Overviews/Methods.html#dayStamp'>dayStamp</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a string with the year, month and day in the format <strong>YYMMDD</strong>.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-hourStamp' href='./../Overviews/Methods.html#hourStamp'>hourStamp</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a string in the format <strong>H:M:S</strong>.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-secStamp' href='./../Overviews/Methods.html#secStamp'>secStamp</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a string with the seconds.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-stamp' href='./../Overviews/Methods.html#stamp'>stamp</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a string in the format <strong>YYMMDD_HHMMSS</strong>.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asSortableString' href='./../Overviews/Methods.html#asSortableString'>asSortableString</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a string in an alphabetically sortable standard database format.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asctime' href='./../Overviews/Methods.html#asctime'>asctime</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a string in the format WeekdayName MonthName Time Year.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asString' href='./../Overviews/Methods.html#asString'>asString</a></h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Returns asctime.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-format' href='./../Overviews/Methods.html#format'>format</a>(<span class='argstr'>format</span>)</h3>
|
|||
|
<div class='method'>
|
|||
|
<p>Obtain a date string with a given format. The character % is replaced by the appropriate value, which is derived from the letter that follows.<textarea class='editor'>Date.getDate.format("Today is %A. It is around %I o'clock (%p), in %B.");
|
|||
|
Date.getDate.format("%d/%m/%Y %H:%M"); // DD/MM/YYYY hh:mm</textarea>
|
|||
|
<h4>Discussion:</h4>
|
|||
|
|
|||
|
<p>A list of formats can be found here: <a href="http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html">http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html</a><dl>
|
|||
|
<dt>%a<dd>Replaced by the locale's abbreviated weekday name. [ tm_wday]<dt>%A<dd>Replaced by the locale's full weekday name. [ tm_wday]<dt>%b<dd>Replaced by the locale's abbreviated month name. [ tm_mon]<dt>%B<dd>Replaced by the locale's full month name. [ tm_mon]<dt>%c<dd>Replaced by the locale's appropriate date and time representation.<dt>%C<dd>Replaced by the year divided by 100 and truncated to an integer, as a decimal number [00,99]. [ tm_year]<dt>%d<dd>Replaced by the day of the month as a decimal number [01,31]. [ tm_mday]<dt>%D<dd>Equivalent to %m / %d / %y. [ tm_mon, tm_mday, tm_year]<dt>%e<dd>Replaced by the day of the month as a decimal number [1,31]; a single digit is preceded by a space. [ tm_mday]<dt>%F<dd>Equivalent to %Y - %m - %d (the ISO 8601:2000 standard date format). [ tm_year, tm_mon, tm_mday]<dt>%g<dd>Replaced by the last 2 digits of the week-based year (see below) as a decimal number [00,99]. [ tm_year, tm_wday, tm_yday]<dt>%G<dd>Replaced by the week-based year (see below) as a decimal number (for example, 1977). [ tm_year, tm_wday, tm_yday]<dt>%h<dd>Equivalent to %b. [ tm_mon]<dt>%H<dd>Replaced by the hour (24-hour clock) as a decimal number [00,23]. [ tm_hour]<dt>%I<dd>Replaced by the hour (12-hour clock) as a decimal number [01,12]. [ tm_hour]<dt>%j<dd>Replaced by the day of the year as a decimal number [001,366]. [ tm_yday]<dt>%m<dd>Replaced by the month as a decimal number [01,12]. [ tm_mon]<dt>%M<dd>Replaced by the minute as a decimal number [00,59]. [ tm_min]<dt>%n<dd>Replaced by a <newline>.<dt>%p<dd>Replaced by the locale's equivalent of either a.m. or p.m. [ tm_hour]<dt>%r<dd>Replaced by the time in a.m. and p.m. notation; in the POSIX locale this shall be equivalent to %I :%M :%S%p. [ tm_hour, tm_min, tm_sec]<dt>%R<dd>Replaced by the time in 24-hour notation (%H : %M ). [ tm_hour, tm_min]<dt>%S<dd>Replaced by the second as a decimal number [00,60]. [ tm_sec]<dt>%t<dd>Replaced by a <tab>.<dt>%T<dd>Replaced by the time ( %H : %M : %S ). [ tm_hour, tm_min, tm_sec]<dt>%u<dd>Replaced by the weekday as a decimal number [1,7], with 1 representing Monday. [ tm_wday]<dt>%U<dd>Replaced by the week number of the year as a decimal number [00,53]. The first Sunday of January is the first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]<dt>%V<dd>Replaced by the week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1. Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]<dt>%w<dd>Replaced by the weekday as a decimal number [0,6], with 0 representing Sunday. [ tm_wday]<dt>%W<dd>Replaced by the week number of the year as a decimal number [00,53]. The first Monday of January is the first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]<dt>%x<dd>Replaced by the locale's appropriate date representation.<dt>%X<dd>Replaced by the locale's appropriate time representation.<dt>%y<dd>Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]<dt>%Y<dd>Replaced by the year as a decimal number (for example, 1997). [ tm_year]<dt>%z<dd>Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ), or by no characters if no timezone is determinable. For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich). If tm_isdst is zero, the standard time offset is used. If tm_isdst is greater than zero, the daylight savings time offset is used. If tm_isdst is negative, no characters are returned. [ tm_isdst]<dt>%Z<dd>Replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. [ tm_isdst]<dt>%%<dd>Replaced by %.</dl>
|
|||
|
|
|||
|
<p>If a conversion specification does not correspond to any of the above, the behavior is undefined.</div><h3><a class='anchor' name='Inherited%20instance%20methods'>Inherited instance methods</a></h3>
|
|||
|
<div id='inheritedinstmets'></div><h3><a class='anchor' name='Undocumented%20instance%20methods'>Undocumented instance methods</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asSMPTE' href='./../Overviews/Methods.html#asSMPTE'>asSMPTE</a>(<span class='argstr'>fps</span>)</h3>
|
|||
|
<div class='extmethod'>From extension in <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/wslib/wslib-classes/Main Features/SMPTE/extDate-fromSMPTE.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/wslib/wslib-classes/Main Features/SMPTE/extDate-fromSMPTE.sc</a></div>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-day' href='./../Overviews/Methods.html#day'>day</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-day' href='./../Overviews/Methods.html#day'>day</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-dayOfWeek' href='./../Overviews/Methods.html#dayOfWeek'>dayOfWeek</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-dayOfWeek' href='./../Overviews/Methods.html#dayOfWeek'>dayOfWeek</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-hour' href='./../Overviews/Methods.html#hour'>hour</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-hour' href='./../Overviews/Methods.html#hour'>hour</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-minute' href='./../Overviews/Methods.html#minute'>minute</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-minute' href='./../Overviews/Methods.html#minute'>minute</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-month' href='./../Overviews/Methods.html#month'>month</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-month' href='./../Overviews/Methods.html#month'>month</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-rawSeconds' href='./../Overviews/Methods.html#rawSeconds'>rawSeconds</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-rawSeconds' href='./../Overviews/Methods.html#rawSeconds'>rawSeconds</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-schedBundle' href='./../Overviews/Methods.html#schedBundle'>schedBundle</a>(<span class='argstr'>bundle</span>, <span class='argstr'>server</span>, <span class='argstr'>timeOfRequest</span>)</h3>
|
|||
|
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/schedBundle.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/schedBundle.sc</a></div>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-second' href='./../Overviews/Methods.html#second'>second</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-second' href='./../Overviews/Methods.html#second'>second</a> = value</h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-year' href='./../Overviews/Methods.html#year'>year</a></h3>
|
|||
|
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-year' href='./../Overviews/Methods.html#year'>year</a> = value</h3>
|
|||
|
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Date.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Date.schelp</a><br>link::Classes/Date::<br></div></div><script src='./../editor.js' type='text/javascript'></script>
|
|||
|
</body></html>
|