forked from as3/as3-utils
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgetAMPM.as
More file actions
24 lines (24 loc) · 685 Bytes
/
getAMPM.as
File metadata and controls
24 lines (24 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package utils.date
{
/**
* Returns a string indicating whether the date represents a time in the
* ante meridiem (AM) or post meridiem (PM).
*
* If the hour is less than 12 then "AM" will be returned.
*
* If the hour is greater than 12 then "PM" will be returned.
*
* @param d1 The Date from which to generate the 12 hour clock indicator.
*
* @return A String ("AM" or "PM") indicating which half of the day the
* hour represents.
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function getAMPM(d:Date):String
{
return (d.hours > 11) ? "PM" : "AM";
}
}