silverorange Code


Swat.SwatDate
/Swat/SwatDate.php at line 15

Class SwatDate

Date
└─SwatDate

public class SwatDate
extends Date

Date Tools

Copyright:
2005-2006 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
final mixed

DF_CC_MY

08 / 2002.

final mixed

DF_DATE

July 2, 2002.

final mixed

DF_DATE_LONG

Tuesday, July 2, 2002.

final mixed

DF_DATE_SHORT

Aug 5, 2002.

final mixed

DF_DATE_SHORT_NOYEAR

Aug 5.

final mixed

DF_DATE_TIME

July 2, 2002 10:09 AM.

final mixed

DF_DATE_TIME_LONG

Tuesday, July 2, 2002 10:09 AM.

final mixed

DF_DATE_TIME_SHORT

Aug 5, 2002 10:09 AM.

final mixed

DF_DATE_TIME_SHORT_NOYEAR

Aug 5, 10:09 AM.

final mixed

DF_MDY

07/02/02.

final mixed

DF_MDY_SHORT

070202.

final mixed

DF_MY

August 2002.

final mixed

DF_TIME

10:09 AM.

final mixed

DF_Y

2002.

final mixed

TZ_COMBINED

AST/ADT.

final mixed

TZ_CURRENT_LONG

Atlantic Standard Time or Atlantic Daylight Time, depending on inDaylightTime() for the date.

final mixed

TZ_CURRENT_SHORT

AST or ADT, depending on inDaylightTime() for the date.

final mixed

TZ_DST_LONG

Atlantic Daylight Time.

final mixed

TZ_DST_SHORT

ADT.

final mixed

TZ_ID

America/Halifax.

final mixed

TZ_LONG

Atlantic Standard Time.

final mixed

TZ_SHORT

AST.

Constructor Summary

SwatDate(mixed date, mixed format)

Method Summary
void

clearTime()

Clears the time portion of the date object.

string

format(mixed format, integer tz_format)

Formats this date given either a format string or a format id.

string

formatTZ(integer format)

Formats the time zone part of this date.

static string

getFormatById(integer id)

Gets a date format string by id.

Field Detail

/Swat/SwatDate.php at line 126

DF_CC_MY

public final mixed DF_CC_MY = 13

08 / 2002


/Swat/SwatDate.php at line 76

DF_DATE

public final mixed DF_DATE = 3

July 2, 2002


/Swat/SwatDate.php at line 81

DF_DATE_LONG

public final mixed DF_DATE_LONG = 4

Tuesday, July 2, 2002


/Swat/SwatDate.php at line 101

DF_DATE_SHORT

public final mixed DF_DATE_SHORT = 8

Aug 5, 2002


/Swat/SwatDate.php at line 106

DF_DATE_SHORT_NOYEAR

public final mixed DF_DATE_SHORT_NOYEAR = 9

Aug 5


/Swat/SwatDate.php at line 86

DF_DATE_TIME

public final mixed DF_DATE_TIME = 5

July 2, 2002 10:09 AM


/Swat/SwatDate.php at line 91

DF_DATE_TIME_LONG

public final mixed DF_DATE_TIME_LONG = 6

Tuesday, July 2, 2002 10:09 AM


/Swat/SwatDate.php at line 111

DF_DATE_TIME_SHORT

public final mixed DF_DATE_TIME_SHORT = 10

Aug 5, 2002 10:09 AM


/Swat/SwatDate.php at line 116

DF_DATE_TIME_SHORT_NOYEAR

public final mixed DF_DATE_TIME_SHORT_NOYEAR = 11

Aug 5, 10:09 AM


/Swat/SwatDate.php at line 66

DF_MDY

public final mixed DF_MDY = 1

07/02/02


/Swat/SwatDate.php at line 71

DF_MDY_SHORT

public final mixed DF_MDY_SHORT = 2

070202


/Swat/SwatDate.php at line 121

DF_MY

public final mixed DF_MY = 12

August 2002


/Swat/SwatDate.php at line 96

DF_TIME

public final mixed DF_TIME = 7

10:09 AM


/Swat/SwatDate.php at line 131

DF_Y

public final mixed DF_Y = 14

2002


/Swat/SwatDate.php at line 47

TZ_COMBINED

public final mixed TZ_COMBINED = 6

AST/ADT


/Swat/SwatDate.php at line 58

TZ_CURRENT_LONG

public final mixed TZ_CURRENT_LONG = 8

Atlantic Standard Time or Atlantic Daylight Time, depending on inDaylightTime() for the date.


/Swat/SwatDate.php at line 52

TZ_CURRENT_SHORT

public final mixed TZ_CURRENT_SHORT = 7

AST or ADT, depending on inDaylightTime() for the date.


/Swat/SwatDate.php at line 42

TZ_DST_LONG

public final mixed TZ_DST_LONG = 5

Atlantic Daylight Time


/Swat/SwatDate.php at line 37

TZ_DST_SHORT

public final mixed TZ_DST_SHORT = 4

ADT


/Swat/SwatDate.php at line 22

TZ_ID

public final mixed TZ_ID = 1

America/Halifax


/Swat/SwatDate.php at line 32

TZ_LONG

public final mixed TZ_LONG = 3

Atlantic Standard Time


/Swat/SwatDate.php at line 27

TZ_SHORT

public final mixed TZ_SHORT = 2

AST


Constructor Detail

/Swat/SwatDate.php at line 136

SwatDate

public SwatDate(mixed date, mixed format)

Method Detail

/Swat/SwatDate.php at line 221

clearTime

public void clearTime()

Clears the time portion of the date object


/Swat/SwatDate.php at line 152

format

public string format(mixed format, integer tz_format)

Formats this date given either a format string or a format id

Parameters:
format - either a format string or an integer format id.
tz_format - optional time zone format id.
Returns:
the formatted date.

/Swat/SwatDate.php at line 175

formatTZ

public string formatTZ(integer format)

Formats the time zone part of this date

Parameters:
format - an integer time zone format id.
Returns:
the formatted time zone.

/Swat/SwatDate.php at line 248

getFormatById

public static string getFormatById(integer id)

Gets a date format string by id

Parameters:
id - the id of the format string to retrieve.
Returns:
the formatting string that was requested.
Throws:
SwatException

silverorange Code