x4Trace Documentation v1.0
Loading...
Searching...
No Matches
Tools.DateTool Class Reference

Represents a date time handler class. Date 1 and date 2 use for synconize date time with another system. More...

Static Public Member Functions

static void Initialize (DateTime date)
 Initializes the date time syncronization.
 
static DateTime Now ()
 Now of date time.
 
static DateTime Today ()
 Returns the current date without time.
 
static string GetFullTimeToString ()
 Returns now as stirng.
 
static string GetDateTimeToString ()
 Returns now as stirng.
 
static string GetDateToString ()
 Returns only the date as string.
 
static bool IsSameDay (DateTime dt1, DateTime dt2)
 Return true when the dates are in same day.
 
static string GetDateToString (DateTime dateTime)
 Returns the date as string.
 
static string GetDateTimeToString (DateTime dateTime)
 Returns the date time as string.
 
static DateTime ToDate (string str)
 Converts a string to date time.
 
static DateTime SetHour (DateTime dateTime, int hour)
 Sets the hour of datetime.
 
static DateTime SetMinute (DateTime dateTime, int minute)
 Set the minute of datetime.
 
static bool IsWeekDay (DateTime dateTime)
 Returns true when the day is a weekday.
 
static void Swap (ref DateTime dt1, ref DateTime dt2)
 Swaps date times.
 
static DateTime GetDate (DateTime dt)
 Returns the date value of DateTime without time.
 

Static Public Attributes

static DateTime emptyDate = DateTime.MaxValue
 Value of empty date.
 
static IFormatProvider formatProvider = System.Globalization.DateTimeFormatInfo.InvariantInfo
 String format of date time.
 

Static Private Attributes

static DateTime date1 = DateTime.Now
 Initialized date time. For example date time on server.
 
static DateTime date2 = DateTime.Now
 Initialized date time on local computer.
 

Detailed Description

Represents a date time handler class. Date 1 and date 2 use for synconize date time with another system.

Member Function Documentation

◆ GetDate()

static DateTime Tools.DateTool.GetDate ( DateTime dt)
static

Returns the date value of DateTime without time.

Parameters
dtDateTime.
Returns
DateTime without time.

◆ GetDateTimeToString() [1/2]

static string Tools.DateTool.GetDateTimeToString ( )
static

Returns now as stirng.

Returns
Now as string.

◆ GetDateTimeToString() [2/2]

static string Tools.DateTool.GetDateTimeToString ( DateTime dateTime)
static

Returns the date time as string.

Parameters
dateTimeThe date time.
Returns
Date time as string.

◆ GetDateToString() [1/2]

static string Tools.DateTool.GetDateToString ( )
static

Returns only the date as string.

Returns
Date as string.

◆ GetDateToString() [2/2]

static string Tools.DateTool.GetDateToString ( DateTime dateTime)
static

Returns the date as string.

Parameters
dateTimeThe date time.
Returns
Date as stirng.

◆ GetFullTimeToString()

static string Tools.DateTool.GetFullTimeToString ( )
static

Returns now as stirng.

Returns
Now as string.

◆ Initialize()

static void Tools.DateTool.Initialize ( DateTime date)
static

Initializes the date time syncronization.

Parameters
date

◆ IsSameDay()

static bool Tools.DateTool.IsSameDay ( DateTime dt1,
DateTime dt2 )
static

Return true when the dates are in same day.

Parameters
dt11 st date time.
dt22 nd date time.
Returns
True when the day is same.

◆ IsWeekDay()

static bool Tools.DateTool.IsWeekDay ( DateTime dateTime)
static

Returns true when the day is a weekday.

Parameters
dateTimeDate time.
Returns
True whe weekday.

◆ Now()

static DateTime Tools.DateTool.Now ( )
static

Now of date time.

Returns
The current datetime.

◆ SetHour()

static DateTime Tools.DateTool.SetHour ( DateTime dateTime,
int hour )
static

Sets the hour of datetime.

Parameters
dateTimeDate time to set.
hourNumber of hour.
Returns
Set datetime.

◆ SetMinute()

static DateTime Tools.DateTool.SetMinute ( DateTime dateTime,
int minute )
static

Set the minute of datetime.

Parameters
dateTimeDate time to set.
minutenumber of minutes.
Returns
Set datetime.

◆ Swap()

static void Tools.DateTool.Swap ( ref DateTime dt1,
ref DateTime dt2 )
static

Swaps date times.

Parameters
dt1Date time 1.
dt2Date time 2.

◆ ToDate()

static DateTime Tools.DateTool.ToDate ( string str)
static

Converts a string to date time.

Parameters
strString to convert.
Returns
The date time.

◆ Today()

static DateTime Tools.DateTool.Today ( )
static

Returns the current date without time.

Returns
DateTime without time.

The documentation for this class was generated from the following file: