SalDateTime
Namespace: PPJ.Runtime
Assembly: PPJ.Web.49 (4.9.0.0)
SAL Date/Time basic type. It wraps .NET native DateTime type. SalDateTime objects are automatically cast to and from DateTime.
- C#
- VB.NET
public struct SalDateTime : ValueType, IComparable, IConvertible, IFormattable, INullable, ISalType, IXmlSerializable, IWisejSerializable
Public Structure SalDateTime
Implements ValueType, IComparable, IConvertible, IFormattable, INullable, ISalType, IXmlSerializable, IWisejSerializable
Constructors
SalDateTime(x)
Creates a new SalDateTime.
| Name | Type | Description |
|---|---|---|
| x | DateTime | DateTime initial value |
SalDateTime(year, month, day)
Create a new SalDateTime
| Name | Type | Description |
|---|---|---|
| year | Int32 | |
| month | Int32 | |
| day | Int32 |
SalDateTime(year, month, day, hour, minute, second)
Create a new SalDateTime
| Name | Type | Description |
|---|---|---|
| year | Int32 | |
| month | Int32 | |
| day | Int32 | |
| hour | Int32 | |
| minute | Int32 | |
| second | Int32 |
SalDateTime(year, month, day, hour, minute, second, milliseconds)
Create a new SalDateTime
| Name | Type | Description |
|---|---|---|
| year | Int32 | |
| month | Int32 | |
| day | Int32 | |
| hour | Int32 | |
| minute | Int32 | |
| second | Int32 | |
| milliseconds | Int32 |
Properties
Current
SalDateTime: Returns the PC's current date/time.
IsNull
Boolean: Checks if this SalDateTime object contain a null value.
Ticks
Int64: Returns the number of ticks.
TreatMinValueAsNull
Boolean: Gets or sets a property that enables the automatic conversion of DateTime.MinValue SalDateTime.Null.
Value
DateTime: Returns the inner DateTime value
Methods
AddDays(days)
Add days or fraction of days to the date.
| Parameter | Type | Description |
|---|---|---|
| days | Double |
Returns: SalDateTime.
Compare(x, y)
Compares two SalDateTime
| Parameter | Type | Description |
|---|---|---|
| x | SalDateTime | |
| y | SalDateTime |
Returns: Int32.
CompareTo(obj)
Compare to object
| Parameter | Type | Description |
|---|---|---|
| obj | Object |
Returns: Int32.
CompareTo(x)
Compare to datetime
| Parameter | Type | Description |
|---|---|---|
| x | SalDateTime |
Returns: Int32.
Day()
Returns the day portion (1 to 31) of a date/time value or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber.
Hour()
Returns the hour portion (0 to 23) of a date/time value or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber.
Minute()
Returns the minute portion (0 to 59) of a date/time value or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber.
Month()
Returns the month portion (1 to 12) of a date/time value or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber.
MonthBegin()
Returns the date of the first day of the month or it returns DATETIME_Null if the value you specify is null. For example, if dtDateTime is December 25, 1992, SalDateMonthBegin returns December 1, 1992.
Returns: SalDateTime. dtMonthBegin
Quarter()
Returns the quarter of the year (1 to 4) of a date/time value or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber. nQuarter
QuarterBegin()
Returns the date of the first day of the quarter of a date/time value or it returns DATETIME_Null if the value you specify is null.
Returns: SalDateTime. dtQuarterBegin
Second()
Returns the seconds portion (0 to 59) of a date/time value or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber. nSeconds
Subtract(x)
Subtract SalDateTime from SalDateTime.
| Parameter | Type | Description |
|---|---|---|
| x | SalDateTime |
Returns: Double.
ToClientTime()
Returns the date/time adjusted to the client's time zone.
Returns: SalDateTime.
ToDateTime()
Returns the DateTime value.
Returns: DateTime.
WeekBegin()
Returns the date of the previous Monday or the current day if it is a Monday or it returns DATETIME_Null if the value you specify is null.
Returns: SalDateTime. dtWeekBegin
Weekday()
Returns the day of the week as a number between 0 and 6 or returns -1 if you specify DATETIME_Null as a parameter. 0 represents Saturday, 1 represents Sunday, and so on.
Returns: SalNumber.
Year()
Returns the year portion of a date or returns -1 if you specify DATETIME_Null as a parameter.
Returns: SalNumber.
YearBegin()
Returns the date of the first day of the year or it returns DATETIME_Null if the value you specify is null.
Returns: SalDateTime. dtYearBegin