Avatar of Kevin Smith
Kevin SmithFlag for United States of America

asked on 

Force a specific time in this vCalendar code...?

I use the vcalendar code to send an appointment from a webform.  How do I use the code below to always have the time set to 8:00:00 am?  So if a user only puts in a date, the code will make sure the appointment is set to 8am.

' Get the start and end dates of the event (GMT).
startDateAdd = request.form("startdate")
endDate = request.form("startdate")
 
' Get a unique ID to assign to the calendar event.
uniqueID = FormatDateTime(Now()) & "-" & tmpName & "-@" &_
   Request.ServerVariables("SERVER_NAME")
 
Set file = fso.CreateTextFile(filename)
 
' Write the iCalendar file to the file system.
file.WriteLine "BEGIN:VCALENDAR"
file.WriteLine "PRODID:-//ASP iCalendar Test//My ASP App V1.0//EN"
file.WriteLine "VERSION:2.0"
file.WriteLine "METHOD:REQUEST"
file.WriteLine "BEGIN:VEVENT"
file.WriteLine "ORGANIZER:MAILTO:" & Session("MM_Username")
file.WriteLine "DTSTART:" & FormatDateTime(startDateAdd)
file.WriteLine "DTEND:" & FormatDateTime(endDate)
file.WriteLine "LOCATION:MSS"
file.WriteLine "TRANSP:OPAQUE"
file.WriteLine "SEQUENCE:0"
file.WriteLine "UID:" & uniqueID
file.WriteLine "DESCRIPTION:New Hire Start Date."
file.WriteLine "SUMMARY:New Hire Start Date"
file.WriteLine "PRIORITY:5"
file.WriteLine "CLASS:PUBLIC"
file.WriteLine "BEGIN:VALARM"
file.WriteLine "TRIGGER:-PT15M"
file.WriteLine "ACTION:DISPLAY"
file.WriteLine "END:VALARM"
file.WriteLine "END:VEVENT"
file.WriteLine "END:VCALENDAR"
ASP.NETVB ScriptOutlook

Avatar of undefined
Last Comment
Kevin Smith
Avatar of Rick
Rick

What date format does the calendar return?

Avatar of Kevin Smith
Kevin Smith
Flag of United States of America image

ASKER

mm/mdd/yyyy hh:mm:ss  and am/pm.  It defaults the time to 12am.
Avatar of Rick
Rick

So you click on a date and time and if you don't choose a time it returns date + 12:00:00 AM?
Avatar of Rick
Rick

  "So if a user only puts in a date, the code will make sure the appointment is set to 8am"

How are they entering the time?

Avatar of Kevin Smith
Kevin Smith
Flag of United States of America image

ASKER

I have a javascript date picker, but they also enter it manually.  All the js does it enter it into the startDateAdd field.
ASKER CERTIFIED SOLUTION
Avatar of Rick
Rick

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Kevin Smith
Kevin Smith
Flag of United States of America image

ASKER

where would I put that?
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo