Working with Dates and Time

Read the article this discussion is about


  1. mdehnel
  2. kmaxim
  3. akidi

This archived discussion is "read only".
For the corresponding "live" discussions, post in the active topic forum here.



Top 1.   Aug 23, 2001 7:15 AM

» mdehnel - Date and Time Combined

Is there a proper way to combine date and time

If I have strings for
mydate August 23, 2001
and
mytime 1:20:00 AM
can I combine them into 1?

I get and error when I try
CDate(08/23/2001 1:20:00 AM)
however Now() and FormatDate(Now(),0)
returns a valid date
what is the format for the combined date and time?

-- posted by mdehnel



Top 2.   Sep 7, 2001 6:29 AM

» kmaxim - Re: Date and Time Combined

In response to message posted by mdehnel:

Thank you for your question. You can combine date and time in one string using string concatenation (&). Consider the following example:


mydate=date() 'Getting system date
mytime=time() 'Getting system time
mydatetime=mydate & mytime 'String concatenation
mydatetime=cdate(mydatetime) 'Using the CdDate() function
document.write mydatetime 'Displaying the result

In your example, CDate(08/23/2001 1:20:00 AM) Script engine can not recognize argument as the date and time literals. You should code it using quotation marks " or better pound sign # (recomended by Microsoft). Try the following:
CDate("08/23/2001 1:20:00 AM") or
CDate(#08/23/2001 1:20:00 AM#).

-- posted by kmaxim



Top 3.   Oct 25, 2002 11:01 AM

» akidi - OUTLOOK APPLICATION USING VBSCRIPT

Hello All,
Please Could anybody help me with this :
I have this Outlook 2000 application development problems which I
dont know how to begin with as even though I've been programming with
other languages I've never done that with outlook using VBScripting. I saw u people's contribution to SUITE101 website.I am doing my final
thesis on this and any asistance rendered will be highly appreciated,
here are the specifications:
>
> Specification (draft)
>
> Functions:
> 1)
> To calculate a running total of flexible working hours and show it in
calendar view based on a reference calendar which is on server in
"Public Folders" with a name "Standard Working Hours"
>
> A separate "balance ticket" can be generated as well and user may open
the balance ticket to get all the required information (daily and running
balance).
>
> Another option is to place the information in the "Tasks" folder of
the user or some other special "Own Working Hours"
>
> 2)
> To calculate own daily working hours based on a reference calendar
which is on server in "Public Folders" with a name "Working Hours"
>
> 3)
> To check that there are no overlapping hours (overlapping
appointments are OK, but the ones starting with an integer are not permitted to
overlap). A RED error ticket may be generated or some other form of error
message should be displayed to the user in error condition.
>
> 4)
> TO make a balance correction - if needed based on special "balance
correction" appoinment on the day given for the future days
>
> 5)
> To produce a (given time span) report of used working hours to
specific codenumber or task. This is extra bonus feature.
>
> Tools:
> 1) Outlook-2000 + forms
> 2) visual basic

> Thankx for your anticipated assistance.
> N.B:
> Please I just need the instructions on how to start and continue

-- posted by akidi



Please follow the guidelines set forth in the Suite101 Posting Etiquette when adding to the discussion.