Class KJUR.jws.IntDate
KJUR.jws.IntDate class
Defined in: jws-3.3.js.
Constructor Attributes | Constructor Name and Description |
---|---|
IntDate class for time representation for JSON Web Token(JWT)
Utility class for IntDate which is integer representation of UNIX origin time
used in JSON Web Token(JWT).
|
Method Attributes | Method Name and Description |
---|---|
<static> |
KJUR.jws.IntDate.get(s)
get UNIX origin time from by string
This method will accept following representation of time.
|
<static> |
KJUR.jws.IntDate.getNow()
get UNIX origin time of current time
This method provides UNIX origin time for current time
|
<static> |
KJUR.jws.IntDate.getZulu(s)
get UNIX origin time from Zulu time representation string
This method provides UNIX origin time from Zulu time.
|
<static> |
KJUR.jws.IntDate.intDate2UTCString(intDate)
get UTC time string from UNIX origin time value
This method provides UTC time string for UNIX origin time value.
|
<static> |
KJUR.jws.IntDate.intDate2Zulu(intDate)
get UTC time string from UNIX origin time value
This method provides Zulu time string for UNIX origin time value.
|
Class Detail
KJUR.jws.IntDate()
IntDate class for time representation for JSON Web Token(JWT)
Utility class for IntDate which is integer representation of UNIX origin time
used in JSON Web Token(JWT).
- Since:
- jws 3.0.1
Method Detail
<static>
{Integer}
KJUR.jws.IntDate.get(s)
get UNIX origin time from by string
This method will accept following representation of time.
- now - current time
- now + 1hour - after 1 hour from now
- now + 1day - after 1 day from now
- now + 1month - after 30 days from now
- now + 1year - after 365 days from now
- YYYYmmDDHHMMSSZ - UTC time (ex. 20130828235959Z)
- number - UNIX origin time (seconds from 1970-01-01 00:00:00) (ex. 1377714748)
- Parameters:
- {String} s
- string of time representation
- Since:
- jws 3.0.1
- Throws:
- "unsupported format: s" when malformed format
- Returns:
- {Integer} UNIX origin time in seconds for argument 's'
<static>
{Integer}
KJUR.jws.IntDate.getNow()
get UNIX origin time of current time
This method provides UNIX origin time for current time
KJUR.jws.IntDate.getNow() => 1478...
- Since:
- jws 3.0.1
- Returns:
- {Integer} UNIX origin time for current time
<static>
{Integer}
KJUR.jws.IntDate.getZulu(s)
get UNIX origin time from Zulu time representation string
This method provides UNIX origin time from Zulu time.
Following representations are supported:
- YYYYMMDDHHmmSSZ - GeneralizedTime format
- YYMMDDHHmmSSZ - UTCTime format. If YY is greater or equal to 50 then it represents 19YY otherwise 20YY.
KJUR.jws.IntDate.getZulu("20151012125959Z") => 1478... KJUR.jws.IntDate.getZulu("151012125959Z") => 1478...
- Parameters:
- {String} s
- string of Zulu time representation (ex. 20151012125959Z)
- Since:
- jws 3.0.1
- Throws:
- "unsupported format: s" when malformed format
- Returns:
- {Integer} UNIX origin time in seconds for argument 's'
<static>
{String}
KJUR.jws.IntDate.intDate2UTCString(intDate)
get UTC time string from UNIX origin time value
This method provides UTC time string for UNIX origin time value.
KJUR.jws.IntDate.intDate2UTCString(1478...) => "2015 Oct ..."
- Parameters:
- {Integer} intDate
- UNIX origin time value (ex. 1478...)
- Since:
- jws 3.0.1
- Returns:
- {String} UTC time string
<static>
{String}
KJUR.jws.IntDate.intDate2Zulu(intDate)
get UTC time string from UNIX origin time value
This method provides Zulu time string for UNIX origin time value.
KJUR.jws.IntDate.intDate2UTCString(1478...) => "20151012...Z"
- Parameters:
- {Integer} intDate
- UNIX origin time value (ex. 1478...)
- Since:
- jws 3.0.1
- Returns:
- {String} Zulu time string