Date Functions

GoldSim inherently understands dates. For example, you can run a Calendar Time simulation (also referred to as a date-time simulation) in which you enter a Start Time and an End Time, and the simulation is then tracked in terms of the calendar time (e.g., when plotting time history results, the X-axis is plotted as dates/times).

Because GoldSim understand dates, you can create and manipulate dates in expressions. You do so by enclosing the date in quotation marks within an expression.

GoldSim also provides several built-in variables (known as Run Properties), such as DateTime (the simulated calendar time) and StartTime (the simulated start date) that represent dates.

To assist in using dates in your models, GoldSim provides a number of specialized functions that can be used to create dates and provide information on variables that represent dates:

 

Function

Description

GetYear(Date)

Returns the calendar year (dimensionless value)

GetMonth(Date)

Returns the calendar month (dimensionless value from 1 to 12)

GetDay(Date)

Returns the day of the month (dimensionless value from 1 to 31)

GetDayofYear(Date)

Returns the day of the year (dimensionless value from 1 to 366)

GetHour(Date)

Returns the hour of the day (dimensionless value from 1 to 24)

GetMinute(Date)

Returns the minute of the hour (dimensionless value from 1 to 60)

GetSecond(Date)

Returns the second of the minute (dimensionless value from 1 to 60)

MakeDate(Year, Month, Day)

Returns a date built from those integer inputs

MakeDateTime(Year, Month, Day, Hour, Minute, Second)

Returns a date/time built from those integer inputs

IsLeapYear(Date) or IsLeapYear(Year)

Returns a condition (True or False)

Date: Must be a specified date/time (e.g., “17 October 2025”, “21 June 2030 13:31:00”) or a variable that represents a date/time (e.g., StartTime).
Year, Month, Day, Hour Minute, Second must be integer values.

Related Topics…

Learn more about: