Getting Current Time
Get the current time:Creating Time Values
Build atime struct by providing year, month, day, etc. Times are always associated with a Location (time zone):
Extracting Time Components
Extract various components of a time value:Comparing Times
Test if one time occurs before, after, or at the same time as another:Time Differences
TheSub method returns a Duration representing the interval between two times:
Duration Units
Compute the duration in various units:Time Arithmetic
UseAdd to advance a time by a duration, or use a negative duration to move backwards:
Common Time Methods
Now() - Current time
Now() - Current time
Returns the current local time
Date() - Create time
Date() - Create time
Creates a time value from components
Before/After/Equal - Compare times
Before/After/Equal - Compare times
Compare two time values
Sub - Time difference
Sub - Time difference
Returns the duration between two times
Add - Time arithmetic
Add - Time arithmetic
Adds a duration to a time
Epoch Time
Get Unix timestamps
Time Formatting
Format and parse time values