StauffConsulting.Essentials.| C#: |
public abstract class DateUtils :
object
|
| VB: |
Public MustInherit Class DateUtils
Inherits Object
|
| Type Ancestry: | Object |
DateUtils |
static | string |
DateFormat |
The standard format string for dates. |
static | string |
DateTimeFormat |
The standard format string for a combined date and time. |
static | TimeUnit> |
InputUnitNames |
Names of units, both long and short (single unit values of TimeUnit only). Each name is lower case, plural. |
static | TimeUnit, string> |
LongUnitNames |
Long names of units (single unit values of TimeUnit only). Each name is lower case, singular. |
static | DateTime |
MaxDateTime |
The maximum valid date and time we allow in TouchWorks. |
static | TimeUnit, string> |
MenuUnitNames |
Names of units for use in menus, radio buttons, etc. Each name is mixed case, singular, with an ampersand before the shortcut character. |
static | DateTime |
MinDateTime |
The minimum valid date and time. DO NOT USE THIS VALUE TO REPRESENT A "NULL" DATETIME! Use NullDateTime instead. |
static | DateTime |
NullDateTime |
This value, and no other, represents a "null" (blank, empty, unspecified) date/time. |
static | TimeSpan |
NullTimeSpan |
This value, and no other, represents a "null" (blank, empty, unspecified) TimeSpan. |
static | TimeUnit, string> |
ShortUnitNames |
Short names of units (single unit values of TimeUnit only). Each name is lower case, singular. |
static | TimeUnit[] |
SingleTimeUnits |
The list of TimeUnit values that represent a single time unit, in descending order of size. |
static | string |
TimeFormat |
The standard format string for times. |
ConvertUnits |
Converts between TimeUnits. |
CountUnits |
Returns the number of units specified in the given TimeUnits value; that is, the number of bits set in the enum. |
CreateTimeSpan |
Creates a TimeSpan from the given values. |
GetDateDiff |
|
GetDateTokens |
Tokenizes an input string into three tokens (numbers or alphabetic names). |
GetLongUnitNames |
Returns a list of the long unit names represented by the given TimeUnit value. |
GetStandardDateString |
Converts a DateTime to a date string in our standard format. |
GetStandardDateTimeString |
Converts a DateTime to a date and time string in our standard format. |
IsSingle |
Returns whether the given TimeUnit value represents a single time unit. |
LexUnitName |
Returns the TimeUnit value corresponding to the given input string. If no match is found, returns TimeUnit.None. If multiple matches are found, returns a TimeUnit with multiple bits set. Case is not significant, nor is leading/trailing whitespace. |
ParseDate |
Converts a string to a date. |
ParseDateTime |
Converts a string to a DateTime. |
ParseDateTime |
|
ParseTime |
Parses a string for a time. |
ParseTime |
|
ParseTimeSpan |
|
ParseTimeSpan |
Parses a string into a TimeSpan. |
TimeSpanToUnits |
Returns the total number of the given time units in the given TimeSpan. |
ToString |
Converts a TimeSpan to a string, using the given units. |
ToString |
Converts a TimeSpan to a string, using the given units. |
| C#: |
protected private DateUtils ()
|
| VB: |
Protected Private Sub New()
|
| C#: |
readonly static string DateFormat;
|
| VB: |
ReadOnly Shared DateFormat As String
|
| C#: |
readonly static string DateTimeFormat;
|
| VB: |
ReadOnly Shared DateTimeFormat As String
|
| C#: |
readonly static System.Collections.Generic.Dictionary
|
| VB: |
ReadOnly Shared InputUnitNames As System.Collections.Generic.Dictionary(Of String, StauffConsulting.Essentials.TimeUnit)
|
| C#: |
readonly static System.Collections.Generic.Dictionary
|
| VB: |
ReadOnly Shared LongUnitNames As System.Collections.Generic.Dictionary(Of StauffConsulting.Essentials.TimeUnit, String)
|
| C#: |
readonly static System.DateTime MaxDateTime;
|
| VB: |
ReadOnly Shared MaxDateTime As Date
|
| C#: |
readonly static System.Collections.Generic.Dictionary
|
| VB: |
ReadOnly Shared MenuUnitNames As System.Collections.Generic.Dictionary(Of StauffConsulting.Essentials.TimeUnit, String)
|
| C#: |
readonly static System.DateTime MinDateTime;
|
| VB: |
ReadOnly Shared MinDateTime As Date
|
| C#: |
readonly static System.DateTime NullDateTime;
|
| VB: |
ReadOnly Shared NullDateTime As Date
|
| C#: |
readonly static System.TimeSpan NullTimeSpan;
|
| VB: |
ReadOnly Shared NullTimeSpan As System.TimeSpan
|
| C#: |
readonly static System.Collections.Generic.Dictionary
|
| VB: |
ReadOnly Shared ShortUnitNames As System.Collections.Generic.Dictionary(Of StauffConsulting.Essentials.TimeUnit, String)
|
| C#: |
readonly static StauffConsulting.Essentials.TimeUnit[] SingleTimeUnits;
|
| VB: |
ReadOnly Shared SingleTimeUnits() As StauffConsulting.Essentials.TimeUnit
|
| C#: |
readonly static string TimeFormat;
|
| VB: |
ReadOnly Shared TimeFormat As String
|
| C#: |
static Decimal ConvertUnits(decimal value,
StauffConsulting.Essentials.TimeUnit oldUnits,
StauffConsulting.Essentials.TimeUnit newUnits)
|
| VB: |
Shared Function ConvertUnits(ByVal value As Decimal, ByVal oldUnits As StauffConsulting.Essentials.TimeUnit, ByVal newUnits As StauffConsulting.Essentials.TimeUnit) As [Decimal]
|
Parameters
value | the value to be converted |
oldUnits | the units to be converted from |
newUnits | the units to be converted to |
| RETURNS | the new value |
| C#: |
static Int32 CountUnits(StauffConsulting.Essentials.TimeUnit units)
|
| VB: |
Shared Function CountUnits(ByVal units As StauffConsulting.Essentials.TimeUnit) As Int32
|
Parameters
units |
| C#: |
static TimeSpan CreateTimeSpan(double value,
StauffConsulting.Essentials.TimeUnit units)
|
| VB: |
Shared Function CreateTimeSpan(ByVal value As Double, ByVal units As StauffConsulting.Essentials.TimeUnit) As TimeSpan
|
Parameters
value | |
units |
| C#: |
static Double GetDateDiff(StauffConsulting.Essentials.DateUtils.CompareFormat format,
System.DateTime StartDate,
System.DateTime EndDate)
|
| VB: |
Shared Function GetDateDiff(ByVal format As StauffConsulting.Essentials.DateUtils.CompareFormat, ByVal StartDate As Date, ByVal EndDate As Date) As [Double]
|
Parameters
format | |
StartDate | |
EndDate |
| C#: |
static String[] GetDateTokens(string input)
|
| VB: |
Shared Function GetDateTokens(ByVal input As String) As [String]()
|
Parameters
input |
| C#: |
static List<> GetLongUnitNames(StauffConsulting.Essentials.TimeUnit units)
|
| VB: |
Shared Function GetLongUnitNames(ByVal units As StauffConsulting.Essentials.TimeUnit) As List(Of )
|
Parameters
units |
| C#: |
static String GetStandardDateString(System.DateTime oDateTime)
|
| VB: |
Shared Function GetStandardDateString(ByVal oDateTime As Date) As [String]
|
Parameters
oDateTime |
| C#: |
static String GetStandardDateTimeString(System.DateTime oDateTime)
|
| VB: |
Shared Function GetStandardDateTimeString(ByVal oDateTime As Date) As [String]
|
Parameters
oDateTime |
| C#: |
static Boolean IsSingle(StauffConsulting.Essentials.TimeUnit unit)
|
| VB: |
Shared Function IsSingle(ByVal unit As StauffConsulting.Essentials.TimeUnit) As [Boolean]
|
Parameters
unit |
| C#: |
static TimeUnit LexUnitName(string input)
|
| VB: |
Shared Function LexUnitName(ByVal input As String) As TimeUnit
|
Parameters
input |
| C#: |
static DateTime ParseDate(string input)
|
| VB: |
Shared Function ParseDate(ByVal input As String) As DateTime
|
Parameters
input |
| C#: |
static DateTime ParseDateTime(string input)
|
| VB: |
Shared Function ParseDateTime(ByVal input As String) As DateTime
|
Parameters
input | the input string, containing both a date and a time |
| RETURNS | the date and time, or NullDateTime if the string contained spaces or nothing |
| C#: |
static DateTime ParseDateTime(string input,
System.Boolean& hasDate,
System.Boolean& hasTime)
|
| VB: |
Shared Function ParseDateTime(ByVal input As String, ByVal hasDate As System.Boolean&, ByVal hasTime As System.Boolean&) As DateTime
|
Parameters
input | |
hasDate | |
hasTime |
| C#: |
static DateTime ParseTime(string input)
|
| VB: |
Shared Function ParseTime(ByVal input As String) As DateTime
|
Parameters
input |
| C#: |
static Boolean ParseTime(System.String& inputParam,
System.DateTime& output)
|
| VB: |
Shared Function ParseTime(ByVal inputParam As System.String&, ByVal output As System.DateTime&) As [Boolean]
|
Parameters
inputParam | |
output |
| C#: |
static TimeSpan ParseTimeSpan(string input,
StauffConsulting.Essentials.TimeUnit& foundUnits)
|
| VB: |
Shared Function ParseTimeSpan(ByVal input As String, ByVal foundUnits As StauffConsulting.Essentials.TimeUnit&) As TimeSpan
|
Parameters
input | |
foundUnits |
| C#: |
static TimeSpan ParseTimeSpan(string input)
|
| VB: |
Shared Function ParseTimeSpan(ByVal input As String) As TimeSpan
|
Parameters
input |
| C#: |
static Double TimeSpanToUnits(System.TimeSpan timeSpan,
StauffConsulting.Essentials.TimeUnit units)
|
| VB: |
Shared Function TimeSpanToUnits(ByVal timeSpan As System.TimeSpan, ByVal units As StauffConsulting.Essentials.TimeUnit) As [Double]
|
Parameters
timeSpan | |
units |
| C#: |
static String ToString(System.TimeSpan timeSpan,
StauffConsulting.Essentials.TimeUnit units)
|
| VB: |
Shared Function ToString(ByVal timeSpan As System.TimeSpan, ByVal units As StauffConsulting.Essentials.TimeUnit) As [String]
|
Parameters
timeSpan | the value to be converted to a string |
units | the units to be used (possibly more than one unit) |
| C#: |
static String ToString(System.TimeSpan timeSpan,
StauffConsulting.Essentials.TimeUnit units,
string format)
|
| VB: |
Shared Function ToString(ByVal timeSpan As System.TimeSpan, ByVal units As StauffConsulting.Essentials.TimeUnit, ByVal format As String) As [String]
|
Parameters
timeSpan | the value to be converted to a string |
units | the units to be used |
format | Optional format string, or null. The syntax depends on the units specified. For a single unit, the format string is passed to double.ToString(). |