Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

In the following snippet of code I'

In the following snippet of code I'

In the following snippet of code I'

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!

RE: In the following snippet of code I'

You do not alter your code, since the appearance relies solely on two parameters :
- 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'

You raise some good points there!

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close