Solved

Urgent ! LotusScript: Text to Date

Posted on 2001-08-24
10
499 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

19 Experts available now in Live!

Get 1:1 Help Now