gedcomx-php
  • Namespace
  • Class

Namespaces

  • Gedcomx
    • Agent
    • Atom
    • Common
    • Conclusion
    • Extensions
      • FamilySearch
        • Platform
          • Artifacts
          • Discussions
          • Tree
          • Users
        • Rt
        • Types
    • GedcomxFile
    • Links
    • Records
    • Rt
    • Search
    • Source
    • Support
    • Types
    • Util
    • Vocab

Classes

  • Collection
  • Duration
  • FormalDate
  • JsonMapper
  • SimpleDate
  • XmlMapper

Class SimpleDate

"Simple date" string is generally: (+|-)YYYY-MM-DDThh:mm:ss((+-)hh:mm|Z) or, using square brackets around optional parts: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss[(+-)hh[:mm]|Z]]]]]]

User: danny yeshurun (ported from Java) Date: 6/23/14 Time: 11:48 PM

Namespace: Gedcomx\Util
Located at Util/SimpleDate.php

Methods summary

public true
# isValid( )

Tell whether this SimpleDate is valid. In particular, make sure that there are no specific date or time parts for which the more general parts are null, and make sure that if isUTC is set, then the time zone hours and minutes are null.

Tell whether this SimpleDate is valid. In particular, make sure that there are no specific date or time parts for which the more general parts are null, and make sure that if isUTC is set, then the time zone hours and minutes are null.

Returns

true
if the date looks valid, false if there is a problem.
public
# parse( $simpleDateString )

Parses the date of the specified formal date string and loads the results into the current instance.

Parses the date of the specified formal date string and loads the results into the current instance.

Parameters

$simpleDateString

Throws

Exception
public string
# __toString( )

Convert the SimpleDate to a formal GedcomX simple date string, of the form: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss]][(+-)hh[:mm]|Z]]]]

Convert the SimpleDate to a formal GedcomX simple date string, of the form: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss]][(+-)hh[:mm]|Z]]]]

Returns

string
public integer
# getDay( )

Get the day of the month as an integer from 1..31.

Get the day of the month as an integer from 1..31.

Returns

integer
public
# setDay( day $day )

Get the day of the month as an integer from 1..31.

Get the day of the month as an integer from 1..31.

Parameters

$day
Day number (1..31), or null if there is no day.
public integer
# getHour( )

Get the hour of the day as an integer from 0 (=midnight) to 23(=11 p.m.)

Get the hour of the day as an integer from 0 (=midnight) to 23(=11 p.m.)

Returns

integer
public
# setHour( hour $hour )

Set the hour of the day as an Integer from 0 (=midnight) to 23 (=11 p.m.). Must be null if there is no day.

Set the hour of the day as an Integer from 0 (=midnight) to 23 (=11 p.m.). Must be null if there is no day.

Parameters

$hour
Hour of the day (0..23) or null if there is no hour.
public boolean
# getIsUTC( )

Get a flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.

Get a flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.

Returns

boolean
public
# setIsUTC( boolean $isUTC )

Set the flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.

Set the flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.

Parameters

$isUTC
public integer
# getMinute( )

Get the minute of the hour as an Integer (0..59). Must be null if there is no hour.

Get the minute of the hour as an Integer (0..59). Must be null if there is no hour.

Returns

integer
public
# setMinute( integer $minute )

Set the minute of the hour as an Integer (0..59) Must be null if there is no hour.

Set the minute of the hour as an Integer (0..59) Must be null if there is no hour.

Parameters

$minute
public integer
# getMonth( )

Get the month as an Integer, where 1=January and 12=December.

Get the month as an Integer, where 1=January and 12=December.

Returns

integer
public
# setMonth( integer $month )

Set the month number as an integer, where 1=January and 12=December.

Set the month number as an integer, where 1=January and 12=December.

Parameters

$month
public integer
# getSecond( )

Get the second of the minute as an Integer (0..59). Must be null if there is no minute.

Get the second of the minute as an Integer (0..59). Must be null if there is no minute.

Returns

integer
public
# setSecond( integer $second )

Set the second of the minute as an Integer (0..59) Must be null if there is no minute.

Set the second of the minute as an Integer (0..59) Must be null if there is no minute.

Parameters

$second
public integer
# getTimeZoneHours( )

Get the hour offset from GMT of the time zone. Ignored if isUTC or if the hours is null.

Get the hour offset from GMT of the time zone. Ignored if isUTC or if the hours is null.

Returns

integer
public
# setTimeZoneHours( integer $timeZoneHours )

Set the hour offset from GMT of the time zone. Ignored if isUTC or if the hours is null.

Set the hour offset from GMT of the time zone. Ignored if isUTC or if the hours is null.

Parameters

$timeZoneHours
public integer
# getTimeZoneMinutes( )

Get the hour minutes of the time zone. Ignored if isUTC or if the timeZoneHours is null.

Get the hour minutes of the time zone. Ignored if isUTC or if the timeZoneHours is null.

Returns

integer
public
# setTimeZoneMinutes( integer $timeZoneMinutes )

Set the minute offset of the time zone. Ignored if isUTC or if the timeZoneHours is null.

Set the minute offset of the time zone. Ignored if isUTC or if the timeZoneHours is null.

Parameters

$timeZoneMinutes
public integer
# getYear( )

Get the year as an integer. Positive years are treated as C.E. (A.D.); Negative years are one less than the B.C.E. (B.C.) year. For example, -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 2000 = 2000 A.D.; 9999 = 9999 A.D.

Get the year as an integer. Positive years are treated as C.E. (A.D.); Negative years are one less than the B.C.E. (B.C.) year. For example, -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 2000 = 2000 A.D.; 9999 = 9999 A.D.

Returns

integer
public
# setYear( integer $year )

Set the year as an integer. Positive years are treated as C.E. (A.D.); Negative years are one less than the B.C.E. (B.C.) year. For example, -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 2000 = 2000 A.D.; 9999 = 9999 A.D.

Set the year as an integer. Positive years are treated as C.E. (A.D.); Negative years are one less than the B.C.E. (B.C.) year. For example, -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 2000 = 2000 A.D.; 9999 = 9999 A.D.

Parameters

$year
gedcomx-php API documentation generated by ApiGen