package server-reason-react
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2d27cb4656208dde8d5eb0c452c590186d092618ac0a04f1ab0a095a3ca58498
sha512=26e16daf87f6b80eff86ccf7df29153527b24e3f4dbc7f13820d1507b0a2e7d6db40fd774bcaad6e6cccff0bf19d4a411b95a10a071f9ce92d52bf07eb08f75f
doc/server-reason-react.js/Js/Date/index.html
Module Js.DateSource
JavaScript Date implementation following ECMA-262 §21.4
This is a spec-compliant implementation using only OCaml stdlib + Unix. Internal representation: float (milliseconds since Unix epoch, or NaN for invalid dates).
The Date type - represents milliseconds since Unix epoch, or NaN for invalid dates
Constructors
Create a Date from year and month (local time). Note: Years 0-99 are treated as 1900-1999
Create a Date from year, month, date (local time)
Create a Date from year, month, date, hours (local time)
val makeWithYMDHM :
year:float ->
month:float ->
date:float ->
hours:float ->
minutes:float ->
tCreate a Date from year, month, date, hours, minutes (local time)
val makeWithYMDHMS :
year:float ->
month:float ->
date:float ->
hours:float ->
minutes:float ->
seconds:float ->
tCreate a Date from all components (local time)
Date.UTC constructors
val utc :
year:float ->
month:float ->
?day:float ->
?hours:float ->
?minutes:float ->
?seconds:float ->
?ms:float ->
unit ->
floatDate.UTC(year, month, date[, hours[, minutes[, seconds[, ms]]]]) Returns epoch milliseconds for the given UTC date components. Note: Years 0-99 are treated as 1900-1999
Date.UTC with year and month only
Date.UTC with year, month, date
Date.UTC with year, month, date, hours
val utcWithYMDHM :
year:float ->
month:float ->
date:float ->
hours:float ->
minutes:float ->
floatDate.UTC with year, month, date, hours, minutes
val utcWithYMDHMS :
year:float ->
month:float ->
date:float ->
hours:float ->
minutes:float ->
seconds:float ->
floatDate.UTC with all components
Date.now and Date.parse
Date.now() - returns current time as epoch milliseconds
Date.parse(string) - parses a date string, returns NaN on failure. Supports ISO 8601 and legacy formats.
Alias for parse
UTC Getters
Local Time Getters
Returns the timezone offset in minutes (positive = west of UTC)
UTC Setters
All setters return the new timestamp (milliseconds).
Local Time Setters
All setters return the new timestamp (milliseconds).
String Conversion
Returns an ISO 8601 formatted string: "YYYY-MM-DDTHH:mm:ss.sssZ" Raises Invalid_argument for invalid dates
Returns locale-formatted date string (simplified implementation)
Returns locale-formatted time string (simplified implementation)