Solved

Urgent ! LotusScript: Text to Date

Posted on 2001-08-24
10
507 Views
Last Modified: 2013-12-18
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!

regards
0
Comment
Question by:eileener
  • 3
  • 3
  • 2
  • +2
10 Comments
 

Expert Comment

by:JoeMunguia
ID: 6421275
eileener,

try

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

hope this helps..
thanks,
Joe.
0
 

Author Comment

by:eileener
ID: 6421303
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!


0
 

Expert Comment

by:JoeMunguia
ID: 6421355
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?

thanks,
Joe.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 4

Expert Comment

by:martijnmulder
ID: 6421359
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...
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6421403
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.

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6421598
Blah Blah... just to get into this discussion !
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6427963
What exactly is it that you want to do in LotusScript ?
0
 

Author Comment

by:eileener
ID: 6430382
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.

Regards


0
 
LVL 8

Accepted Solution

by:
Jean Marie Geeraerts earned 100 total points
ID: 6430850
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,

Jerrith
0
 

Author Comment

by:eileener
ID: 6451857
Thanks guys!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question