How to retrieve the user date format?

peterraeves
Mega Guru

What's the function we can use to get the user's personal date format?

1 ACCEPTED SOLUTION

Yes, it was gs.getSession().getUser().getDateFormat()


View solution in original post

10 REPLIES 10

Chuck Tomasi
Tera Patron

You could get it right from the sys_user table using the 'date_format' field.


That's what I do now, but this might cause me issues.



The user format is part of the session. So even if you change the format on the user table, as long as the session is not renewed, the user will still be working with his old format. This will give problems if you use the new format, with values in the old format. So i had hoped for something like gs.getUser().getDateFormat(). But it seems that does not exist?


Hi Peter,



Checking this Out of curiosity, did you try the below method?



gs.getSession().getUser().getTimeFormat()


You probably mean


gs.getSession().getUser().getDateFormat()


But, yes! This is what I was looking for ^^. Thanks