In the following snippet of code I'
In the following snippet of code I'
(OP)
In the following snippet of code I'm establishing todays date.
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As Notesdatabase
Dim maindoc As NotesDocument
Dim doc As NotesDocument
Dim dateTime As New NotesDateTime( "" )
dateTime.LSLocalTime = Now
doc.maindoc_line= Cstr(dateTime.DateOnly)
In my application the date is appearing as MM/DD/YYYY. Being in Australia I need DD/MM/YYYY. How do I alter this code so it relects the correct format?
Many thanks!
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As Notesdatabase
Dim maindoc As NotesDocument
Dim doc As NotesDocument
Dim dateTime As New NotesDateTime( "" )
dateTime.LSLocalTime = Now
doc.maindoc_line= Cstr(dateTime.DateOnly)
In my application the date is appearing as MM/DD/YYYY. Being in Australia I need DD/MM/YYYY. How do I alter this code so it relects the correct format?
Many thanks!
RE: In the following snippet of code I'
- the Notes clients that are used
- the parameters in Regional Settings in Windows
Indeed, if you are working with R5/6 everywhere, then you can change the field display to Custom in Field Properties and ensure that the display is as you need it to be on the document.
Otherwise, Notes will adapt itself automatically following the Date settings defined in Windows.
If you really want to make sure, just use a Computed for Display field that reformats your date in text when the user opens the document.
Be aware that the server does not like having date formats tinkered with in views. Doing so will probably jeapordize the integrity of the view if the date column is used in sorting.
If you really want date format to be fixed in views, then you will be better off using a hidden column for the true value, and displaying your format in a visible, non-sorted column after the hidden one.
This said, I must admit I question the validity of fixing the date format. Given that Notes adapts itself automatically to the users regional settings, I find that such practices put the validity of the information in peril without a format reminder behind the value.
But that is just my opinion.
RE: In the following snippet of code I'
I think I've now solved the problem. An agent running on the server was creating dates with the format correct. I discovered that 1 workstation that was running another agent locally and updating fields in his local replica had the system date format as US. I couldn't work out why the same code was producing different results.
Thanks for your reply.