Skip to main content
Version: 3.5

DateTimeExtensions

Namespace: System

Assembly: Wisej.Framework (3.5.0.0)

Extends DateTime with methods to adjust the server-side time to the client's timezone.

public class DateTimeExtensions
info

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Methods

Static memberToClientTime(value)

Converts the DateTime value to the time zone of the client's browser. When the timezone of the server doesn't match the time zone of the client, you should convert to the client's timezone when using Now.

ParameterTypeDescription
valueDateTimeThe DateTime to adjust to the client's time zone.

Returns: DateTime.

Static memberToClientTime(value, timezoneOffset)

Converts the DateTime value to the time zone of the client's browser. When the timezone of the server doesn't match the time zone of the client, you should convert to the client's timezone when using Now.

ParameterTypeDescription
valueDateTimeThe DateTime to adjust to the client's time zone.
timezoneOffsetInt32The time-zone offset in minutes.

Returns: DateTime.