2

I need to capture the current users current time in a VF page. Is there a way to capture that info in controller?

3

If you don't mind having the date in there:

System.now().format()
8

Spring '13 will have a TimeZone class. You'll be able to get the timezone for the current user and do whatever math you need based on its offset from GMT.

2
2

System.Now should give you the Current time and display to the User in his local current time Zone .

Other approach is to get the locale using userinfo.getlocale

1)Maintain an offset in custom setting

2)From GMT time you can set the Offset.

I would say that simply system.Now gets you time in the Time Zone of the User

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.