A class used to format non DateTime times generated by the Zmanim package. For example the AstronomicalCalendar.GetTemporalHour() returns the length of the hour in milliseconds. This class can format this time. More...
Public Member Functions | |
ZmanimFormatter () | |
ZmanimFormatter (int format, string dateFormat) | |
virtual void | SetTimeFormat (int format) |
virtual string | Format (double milliseconds) |
virtual string | Format (int millis) |
virtual string | Format (Time time) |
virtual string | FormatDate (DateTime date, IDateWithLocation dateWithLocation) |
virtual string | GetXSDate (DateTime date, IDateWithLocation cal) |
virtual string | FormatXSDDurationTime (long millis) |
virtual string | FormatXSDDurationTime (Time time) |
Static Public Member Functions | |
static string | ToXml (AstronomicalCalendar ac) |
Public Attributes | |
const int | SEXAGESIMAL_XSD_FORMAT = 0 |
Format using hours, minutes, seconds and milliseconds using the xsd:time format. This format will return 00.00.00.0 when formatting 0. /summary> | |
const int | DECIMAL_FORMAT = 1 |
const int | SEXAGESIMAL_FORMAT = 2 |
Format using hours and minutes. | |
const int | SEXAGESIMAL_SECONDS_FORMAT = 3 |
Format using hours, minutes and seconds. | |
const int | SEXAGESIMAL_MILLIS_FORMAT = 4 |
Format using hours, minutes, seconds and milliseconds. | |
const long | HOUR_MILLIS = MINUTE_MILLIS * 60 |
constant for milliseconds in an hour (3,600,000) | |
const int | XSD_DURATION_FORMAT = 5 |
Properties | |
virtual string | DateFormat [get, set] |
Gets the date format. |
A class used to format non DateTime times generated by the Zmanim package. For example the AstronomicalCalendar.GetTemporalHour() returns the length of the hour in milliseconds. This class can format this time.
<author>Eliyahu Hershfeld</author>
Zmanim.Utilities.ZmanimFormatter.ZmanimFormatter | ( | ) |
summary> ZmanimFormatter constructor using a formatter /summary> param name = "format"> int The formatting style to use. Using ZmanimFormatter.SEXAGESIMAL_SECONDS_FORMAT will format the time time of 90*60*1000 + 1 as 1:30:00
param name = "dateFormat">The date format.
Zmanim.Utilities.ZmanimFormatter.ZmanimFormatter | ( | int | format, | |
string | dateFormat | |||
) |
summary> Sets the format to use for formatting. /summary> param name = "format"> int the format constant to use.
virtual string Zmanim.Utilities.ZmanimFormatter.Format | ( | Time | time | ) | [virtual] |
summary> Formats a date using this classe's date format. /summary> param name = "date"> the date to format
param name = "dateWithLocation"> the TimeZone and DateTime used to help format based on the Calendar's DST and other settings.
returns> the formatted string
virtual string Zmanim.Utilities.ZmanimFormatter.Format | ( | int | millis | ) | [virtual] |
summary> A method that formats Timeobjects. /summary> param name = "time"> The time Object
to be formatted.
returns> String The formatted String
virtual string Zmanim.Utilities.ZmanimFormatter.Format | ( | double | milliseconds | ) | [virtual] |
summary> A method that formats milliseconds into a time format. /summary> param name = "millis"> The time in milliseconds.
returns> String The formatted String
virtual string Zmanim.Utilities.ZmanimFormatter.FormatDate | ( | DateTime | date, | |
IDateWithLocation | dateWithLocation | |||
) | [virtual] |
summary> The date:date-time function returns the current date and time as a date/time string. The date/time string that's returned must be a string in the format defined as the lexical representation of xs:Date in [3.3.8 Date] of [XML Schema 1.1 Part 2: Datatypes]. The date/time format is basically CCYY-MM-DDThh:mm:ss, although implementers should consult [XML Schema 1.1 Part 2: Datatypes] and [ISO 8601] for details. The date/time string format must include a time zone, either a Z to indicate Coordinated Universal Time or a + or - followed by the difference between the difference from UTC represented as hh:mm. /summary>
virtual string Zmanim.Utilities.ZmanimFormatter.FormatXSDDurationTime | ( | Time | time | ) | [virtual] |
summary> A method that returns an XML formatted String
representing the serialized Object
. The format used is:
<AstronomicalTimes date="1969-02-08" type="net.sourceforge.zmanim.AstronomicalCalendar algorithm="US Naval Almanac Algorithm" location="Lakewood, NJ" latitude="40.095965" longitude="-74.22213" elevation="25.4" timeZoneName="Eastern Standard Time" timeZoneID="America/New_York" timeZoneOffset="-5"> <Sunrise>2007-02-18T06:45:27-05:00</Sunrise> <TemporalHour>PT54M17.529S</TemporalHour> ... </AstronomicalTimes>
Note that the output uses the xsd:Date format for times such as sunrise, and xsd:duration format for times that are a duration such as the length of a temporal hour. The output of this method is returned by the AstronomicalCalendar.ToString }. /summary> returns> The XML formatted String
. The format will be:
<AstronomicalTimes date="1969-02-08" type="net.sourceforge.zmanim.AstronomicalCalendar algorithm="US Naval Almanac Algorithm" location="Lakewood, NJ" latitude="40.095965" longitude="-74.22213" elevation="25.4" timeZoneName="Eastern Standard Time" timeZoneID="America/New_York" timeZoneOffset="-5"> <Sunrise>2007-02-18T06:45:27-05:00</Sunrise> <TemporalHour>PT54M17.529S</TemporalHour> ... </AstronomicalTimes>
/returns>
virtual string Zmanim.Utilities.ZmanimFormatter.FormatXSDDurationTime | ( | long | millis | ) | [virtual] |
summary> This returns the xml representation of an xsd:duration object. /summary> param name = "time"> the duration as a Time object
returns> the xsd:duration formatted String
virtual string Zmanim.Utilities.ZmanimFormatter.GetXSDate | ( | DateTime | date, | |
IDateWithLocation | cal | |||
) | [virtual] |
summary> Represent the hours and minutes with two-digit strings. /summary> param name = "digits"> hours or minutes.
returns> two-digit String representation of hrs or minutes.
static string Zmanim.Utilities.ZmanimFormatter.ToXml | ( | AstronomicalCalendar | ac | ) | [static] |
summary> Determines if a method should be output by the ToXml /summary> param name = "method"> Should this method be inculeded.
const long Zmanim.Utilities.ZmanimFormatter.HOUR_MILLIS = MINUTE_MILLIS * 60 |
constant for milliseconds in an hour (3,600,000)
summary> Format using the XSD Duration format. This is in the format of PT1H6M7.869S (P for period (duration), T for time, H, M and S indicate hours, minutes and seconds. /summary>
const int Zmanim.Utilities.ZmanimFormatter.SEXAGESIMAL_FORMAT = 2 |
Format using hours and minutes.
Format using hours, minutes, seconds and milliseconds.
Format using hours, minutes and seconds.
const int Zmanim.Utilities.ZmanimFormatter.SEXAGESIMAL_XSD_FORMAT = 0 |
Format using hours, minutes, seconds and milliseconds using the xsd:time format. This format will return 00.00.00.0 when formatting 0. /summary>
summary> Format using standard decimal format with 5 positions after the decimal. /summary>
virtual string Zmanim.Utilities.ZmanimFormatter.DateFormat [get, set] |
Gets the date format.