XF 2.2 Get datetime in user's context

stromb0li

Well-known member
My search-fu is failing me here. How do I obtain the current time, offset with the logged in user's timezone, vs server time inside my controller? Right now \Datetime will only obtain time based on server timezone.
 
Not trying to display the date via template; trying to get the friendly string localized programmatically in the controller class.
 
Sorry to bubble up an older thread, but if I have two controls to try and get the day and time (dateinput for day and input type of time for time), what is the best way to calculate the dateTime for that?

Right now my current approach is to datetime the day input, and then calculate the number of seconds from the time input; adding them both together.
 
Back
Top Bottom