Solved

Urgent ! LotusScript: Text to Date

Posted on 2001-08-24
10
492 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now