Class DateTimeUtil
Assembly: SoDataBase.dll
Syntax
public static class DateTimeUtil
Methods
GetEndTime(DateTime, DateTimeSearchType)
Declaration
public static DateTime GetEndTime(DateTime time, DateTimeSearchType type)
Parameters
Returns
GetStartTime(DateTime, DateTimeSearchType)
Declaration
public static DateTime GetStartTime(DateTime time, DateTimeSearchType type)
Parameters
Returns
ToStringWithConditionalDate(DateTime)
Convert the given datetime to string, using the CultureDataFormatter.
If the date part
is the same as today, do not prepend the date; otherwise do prepend the date
Declaration
public static string ToStringWithConditionalDate(DateTime dateTime)
Parameters
| Type |
Name |
Description |
| DateTime |
dateTime |
DateTime to format
|
Returns
| Type |
Description |
| string |
Either date + time or just time
|
ToStringWithConditionalDate(DateTime, DateTime)
Convert the given datetime to string, using the CultureDataFormatter.
If the date part
is the same as the date of the reference, do not prepend the date; otherwise do prepend the date
Declaration
public static string ToStringWithConditionalDate(DateTime dateTime, DateTime reference)
Parameters
| Type |
Name |
Description |
| DateTime |
dateTime |
DateTime to format
|
| DateTime |
reference |
Reference date; date will be prepended in the result if this is different from the datetime to format
|
Returns
| Type |
Description |
| string |
Either date + time or just time
|