Links

DateTimeExtensions

System.DateTimeExtensions
Namespace: System
Assembly: Wisej.Framework (3.2.0.0)
Extends DateTime with methods to adjust the server-side time to the client's timezone.
C#
VB.NET
public class DateTimeExtensions
Public Class DateTimeExtensions
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

ToClientTime(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.
Parameter
Type
Description
value
DateTime
The DateTime to adjust to the client's time zone.
Returns: DateTime.

ToClientTime(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.
Parameter
Type
Description
value
DateTime
The DateTime to adjust to the client's time zone.
timezoneOffset
Int32
The time-zone offset in minutes.
Returns: DateTime.