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

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


That method appears to return the time format, there's also one for date format, which I think is what Peter was looking for.



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



I just ran it in scripts background like this:



gs.info(gs.getSession().getUser().getDateFormat());



and it appeared to print the right value although I didn't do any checking after switching my profile. Testing costs extra.


Yes, Testing costs extra


Gowrisankar Sat
Tera Guru

Just go to user profile and check this field.



Date Format (date_format)


prasanna11
Mega Guru

gs.info(gs.getSession().getUser().getDateFormat()); 

 

Will not work , if you are trying to run the script in bg script from a scoped app. This works on global scope only.