Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are two classes, of the same name, <code>DateTimeFormatter</code>. One is a pure Actionscript class, the other is a new class added to Flex 4.5 that wraps the Actionscript version. The <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/formatters/DateTimeFormatter.html" rel="nofollow">Flex version</a> does some of the heavy lifting for you.</p> <p>There is a <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/formatters/DateTimeFormatter.html#getFirstWeekday%28%29" rel="nofollow"><code>getFirstWeekday()</code></a> method, it will be respective of the locale you specify.</p> <p>[Edit] I got carried away, didn't answer your question specifically. I'm not aware of anything more elegant than the DateTimeFormatter. But from there you can use a <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html" rel="nofollow">Date</a> object to get the current time, and get what you're after.</p> <p>There are a handful of date utilities, but I'm not aware of this particular solution. Are you looking for something like this:</p> <pre><code>var timeFormatter:DateTimeFormatter = new DateTimeFormatter(LocaleID.DEFAULT, DateTimeStyle.NONE, DateTimeStyle.SHORT); var firstDay:int = timeFormatter.getFirstWeekday() var now:Date = new Date(); var dayDelta:int = now.day - firstDay; var firstDayInMillis:Number = now.time - (dayDelta * 86400 * 1000); // you can construct a new Date from here: var first:Date = new Date(firstDayInMillis); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload