1. Using Personalization
%ClientDate:
%ClientDate returns the current date for the current user, adjusted for the user’s time zone. This is the date as specified with the current user's personalizations.You can use this system variable as the default constant for a date field.This is potentially one day different than the server date, which is returned with %Date.
Let's say, the Server is located in US, the business users spread across Global Other than US.
So, if we issue %Date (or any other Date variables) it will return server time.
Suppose if the bussiness user located in India, he should get Date time in IST.
2.Using DateTimeToTimeZone
syntax
DateTimeToTimeZone(OldDateTime, SourceTimeZone, DestinationTimeZone)
Use the DateTimeToTimeZone function to convert datetimes from the datetime specified by SourceTimeZone to the datetime specified by DestinationTimeZone.
to know the client zone use the variable:- %ClientTimeZone
Eg:- DateTimeToTimeZone(
this will convert US date time to Indian Std Date time.
Refer to:-
PeopleBooks: PeopleCode Language Reference
:-)
No comments:
Post a Comment