Urgent ! LotusScript: Text to Date

Hi !

Required: date returned in format mm/dd/yyyy (excluding time) of data type Date/Time
eg. 08/24/2001
I need the zero in front of the month and day.

Language used = LotusScipt

I've tried DateNumber and all other date functions available but still can't get it!

Could someone please enlighten me?

Thanks in advance!

Who is Participating?

Improve company productivity with a Business Account.Sign Up

Jean Marie GeeraertsConnect With a Mentor Application EngineerCommented:
In stead of the @Text(Date), if you're passing it from LotusScript pass the string value provided by the format$ command. It should work :

e.g. print {<a href=\"} + link + subject + "/" + type + "/" + directory + {/default.htm" target=_blank>} + strDate + "</a>"

Where strDate is a stringvariable containing the date in the required format.
As in my previous comment, you can construct the string date as follows :
   strDate = format$(orignalDate, "mm/dd/yyyy")
I use the curly braces {,} because then you can include double quotes " as if it were regular characters and it makes the code a bit easier to read afterwards.
If you use the print statement to put the link in a dynamically generated HTML-document, you don't need to include the square brackets [,]. If the code puts the string in a field, you do have to add the square brackets [,].

Hope this clears things up for you,



doc.newdate = Format(datetochange,"mm/dd/yyyy")

hope this helps..
eileenerAuthor Commented:
Hi JoeMunguia,

Format(datetochange,"mm/dd/yyyy")will return a date that is String.
I need it to be returned as Date/Time.

Thanks anyways!

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi eileener,

The way that the date is displayed (for actual date fields, not text fields) is determined by the operating system for Notes clients, and the Domino server for web applications.  I dont think you can change this unless you actually go into control panel and change the format to US.  Is it not possible to display the field that you want as text and use Format() and save the real date value in a hidden field?

in lotusscript the dates always look the same. where does it have to look in the format mm/dd/yyyy ? If it is in a field you just set the field properties in a view you set the column properties...
Jean Marie GeeraertsApplication EngineerCommented:
A way to convert it to text and displaying the leading zeros is the following :
displayDate = format$(orignalDate, "mm/dd/yyyy")

Where displayDate is a string variable and originalDate is a Variant containing the Date/Time value.

Blah Blah... just to get into this discussion !
Jean Marie GeeraertsApplication EngineerCommented:
What exactly is it that you want to do in LotusScript ?
eileenerAuthor Commented:
Hi all,

Thanks for your comments.

Basically, this was part of the codes to automate the creation of calendar entries of web stats reports generated.

I needed to pass a Date/Time value of yesterday's date into the hyperlink below and needed it in the format mm/dd/yyyy:

"[<a href=\"" + link+ subject + "/" + type + "/" + directory + "/default.htm\" target=_blank>" + @Text(date) + "</a>]"

I could actually do it without changing the date/time to text, but the time portion would be displayed in the entry.

I wanted to know if there's any way to omit the time portion of the date/time value.

Sorry if I confused everyone. Currently, I just made do with the inclusion of time portion in my date.

This seems so easy yet so tricky.


eileenerAuthor Commented:
Thanks guys!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.