com. kelvinluck. util. DateFormat

Just a very simple class to hold some functions for formating a Flash Date object.

No need to create instances of the class - just use the static methods it provides...

Version

0.1.0

Author

Kelvin Luck < kelvin at kelvinluck dot com >

Summary
Just a very simple class to hold some functions for formating a Flash Date object.
Private constructor to prevent you creating instances of this class
Static function which converts a given Date object into an ISO / MySQL Date Stamp format (e.g.
Static function which converts a given ISO / MySQL Date Stamp Format String (e.g.
Simple function to make sure a number is the right amount of characters long - used internally by dateToIso.

Functions

DateFormat

private function DateFormat()

Private constructor to prevent you creating instances of this class

dateToIso

public static function dateToIso(date: Date):String

Static function which converts a given Date object into an ISO / MySQL Date Stamp format (e.g.  “yyyy-mm-dd hh:mm:ss”)

isoToDate

public static function isoToDate(dateStr: String):Date

Static function which converts a given ISO / MySQL Date Stamp Format String (e.g.  “yyyy-mm-dd hh:mm:ss”) into a Date object

_zeroPad

private static function _zeroPad(value: Number):String

Simple function to make sure a number is the right amount of characters long - used internally by dateToIso.

Parameters

valueThe number you want to zero pad.

TODO

Maybe add a second parameter which is how many zeros you want to pad it with?

private function DateFormat()
Private constructor to prevent you creating instances of this class
public static function dateToIso(date: Date):String
Static function which converts a given Date object into an ISO / MySQL Date Stamp format (e.g.
public static function isoToDate(dateStr: String):Date
Static function which converts a given ISO / MySQL Date Stamp Format String (e.g.
private static function _zeroPad(value: Number):String
Simple function to make sure a number is the right amount of characters long - used internally by dateToIso.