Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP & have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for

Time Format

I am trying to get a time to display with AM or PM (not the 24 hour clock). When I use:

<%=FormatDateTime(Now(), vbLongTime)%>

I get 21:28:37 I want 9:28 PM .

View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Time/Date Format And Changing Time To GMT
Currently working on a ASP for a friend, which requires the date and
time on it. It pulls in entries from an Access Database with dates and
times in the format of:

"Fri Oct 17 18:02:46 2003"
However my date and time on the ASP page is displayed as:
"Friday, October 17, 2003 18:02:46"
using the script:
"<%Session.LCID = 1033%>
<%=FormatDateTime(Date(), vbLongDate)%>
<%Session.LCID = 2057%>

Anyone know how to change this script, fully or partly to produce the
date and time on the format that's in the access database i.e. "Fri Oct 17
18:02:46 2003" Code:

View Replies !   View Related
Format-time In Xsl
I have and XSL page that transforms my XML data from MSSQL. The way I display datetime variable from XML within XSLT is:

<xsl:value-of select="ms:format-time(Modified, 'h:mm tt')" />

Which is fine, except it gives me time in UCT, when I need it in Eastern (-5 GMT) time.
XML actually has the correct data and it shows -5, but XSLT will only display UCT. How can I fix that?

View Replies !   View Related
Asp Sql Time Format
Working in VBScript ASP page with MSAccess Db. Well I'm darn embarrased for this to be my first post on here - you know when you've solved all the big stuff and then some tiny stupid little thing sends you flat opn your face ?

I want to put a time into my sql statement, like this :

INSERT INTO hoursTbl (opening,closing) VALUES ('09:15','17:35')





etc etc....

nearly all of them work if I run them in Access itself, but none are working in my ASP page. I get the standard 'syntax error in INSERT statement' error message

Is it a special syntax I need?

View Replies !   View Related
How Do I Format Time?
I'm using an Access db and have a field which holds the time of an event. The field is a text type as when I chose date/time format when displaying it on my ASP I couldn't format it. So anyway, I display my date like so

strStartTime = rs("StartTime)
FormatDateTime(strStartTime, vbshorttime)

which formats the time in a 24hr format but I want to display am/pm, how do I do that?

View Replies !   View Related
Time Format
I've made my own guestbook in asp and everythink is working fine. The page is hosted on a server located at USA and the record time is displayed with AM and PM... How can I put it like 16:00 for example?

View Replies !   View Related
Format Time
I'm trying to us the formatdatetime function to format US-time and it doesnt give me the seconds. how to do that?

2002-02-02 06:00 AM gives 6:00 AM when I want 6:00:00 AM

View Replies !   View Related
Time Format
When pulling the hour (or minute, or second, or day, or month, etc) from
the server like:

<%= hour(time) %>

Is there a quick way (like, without an if then statement to check it and
fix it) to format it so it represents all hours in two digits like:


for 12 am. instead of just:



View Replies !   View Related
Format Date Time
I am trying to format the following line fo code so that it shows tha date time in my database as dd mm yyyy

currently in the database it shows as 2006-10-03 08:01:00

Here is the code that I want to format it is posssible to format it in such a way???

Response.Write "<td class=TableFieldInput>" &trim(rsSet("Archive_date")) &"</td>"

View Replies !   View Related
Date/Time Format
i am using ms access for my database.there is a table named Reservation and of the field inside this table is resDate which is the format is Date/ my asp page (use vbscript), there is a variable where i coded it like this, res_Date = Date().the save data process is just fine but when i look into the data database, my resDate stored data just like this 12:00:00 AM.but when i try display res_Date at asp page, it shows the current data like 12/7/ there any wrong with my code or i just left something?

View Replies !   View Related
What Format Date And Time Should I Use
I trying to do a start date/time and end date/time data from database to performance check it is overdue from an asp file.

So I have Start Date/Time and End Date/Time form textfields. The time textfield is 24hour format. The date are 3 fields Day,month and Year. Code:

View Replies !   View Related
Format Time Field
I have this field time field in my database which has records in the military format



Can anyone tell me how to come up with a slick function to show results in the normal time format

View Replies !   View Related
Format Time Display
I am using the query bellow to display some fielsd on my page and am having some problema displaying the data from calltime. I have the field setup in access as short time but when it is displayed on the page it displays as 12:15 AM. How can I remove the AM/PM from the display?

<% notesSQL = "Select * From notes where callID =" &RSupdate("callID")
Set RScalls = dbConnection.Execute(notesSQL)
Do While Not RScalls.EOF
<%=rscalls("notes")%> &nbsp;Added by: <%=rscalls("employee")%> on
<%=rscalls("notesdate")%> &nbsp;Time Spent: <%= rscalls("calltime") %><br>

View Replies !   View Related
Format Date Time
I'm trying to format 5/23/2005 9:00:00 AM to look like 20050523T140000. How can this be done with ASP? I have a VB version, but ASP uses FormatDateTime and I saw no equivilent switches.

View Replies !   View Related
Time Format: Get Rid Of Seconds
I have a simple calendar scipt that ask for time of event input. While I like the time feature I do not like the fact that it displays with seconds included.

Ex. Displays HR:MIN:SEC 5:05:30 PM

Desired display 5:05 PM

How do I get rid of the display showing seconds? I have changed the database format, but this does not seem to effect the disply on the asp page.

View Replies !   View Related
Testing Date/time Format
I want date inputs to be in the form "d-m-yyy h:m:s". On submitting a form. I want any date input not i this format to be alerted for the correct format.

View Replies !   View Related
Time Format Conversion Question
I have a variable that contains a time value in the format HH:MM:SS that indicates a duration rather than a clock time, and I need to convert it to plain seconds so an input of "00:07:01" would output "421". I'm not too good with time/date conversions, and I can't seem to get this one working right. Is there anyone out there that already has a script that does this or someone who could point me in the right direction?

View Replies !   View Related
Converting The Time Format Throw Asp?!@
i use this code to convert the date format throw asp. so it could work well with me sql server Db Code:

strSQL="select * from Visit where convert(datetime,visitdate,103) = convert(datetime,'" & date() &"',103) ORDER BY visittime"
rs.Open strSql

but u try to convert the tme form also in the same way but it doesnt work , so anybody have any idea how could this be done? Code:

View Replies !   View Related
Display Time In 12hr Clock Format
I try to display the time from an access db in 12hr clock format. Am I missing something simple? The time is held in the medium date format ie 07.30pm and I'm using:

FormatDateTime(rs("StartTime"), vbshorttime)

but this displays 19:30 instead of 7:30. If I change to vblongtime I get 19:30:00 and if I change the time field format to short time I still get 19:30. What am I doing wrong??!

View Replies !   View Related
Remove "AM" In Time() Format
just want to ask how can i remove the letters "AM" or "PM" in this code:

View Replies !   View Related
Script To Format Existing Access Table Into Wall Calendar Format?
I have the tables set up in Access, viewing in column format on ASP pages but now the company wants the schedule reports to be in a wall-calendar type format. I've searched and found calendar scripts but I need one that's creates a table resizable to a report size format. Using the existing MS Access db I've written is also a plus.

Any suggestions on where to start?

View Replies !   View Related
Convert Any Audio Format Files To Vox Format
if there any asp or vb functions that can convert any audio format files to vox format.

View Replies !   View Related
How To Format Date In MM/DD/YYYY Format
how to format date in MM/DD/YYYY format in ASP?

View Replies !   View Related
Time Calculation :: Difference Between Login And Current Time
I would like to display the difference between the logging time
[Session("start"] and the current time [now]. In hours minutes and seconds,
I have tried a couple of things but all I see is gobbledy gook.

View Replies !   View Related
ASP To Re-load Page From Time To Time To Reset Varaibles
I have a website that I subscribe to that allows me to track tasks. I have an extra computer with a big monitor that i want to always display the task list. the problem is after so many hours I get logged out.

I need to need to reload that sign in url every few hours Code:

View Replies !   View Related
Comapring Database Time And Computer Date/time
there i was just windering how do i compare a date/time vlaue in sql server agaisnt the computers' date/time.
for example, if computer date/time is two months or 2 weeks before the database date/time do something

View Replies !   View Related
Time Convert String To OdbcType.Time
I am working on a database that collects information about incidents. One of the fields that people enter is the time of the incident. I am trying to convert that string that people enter into a OdbcType.Time and I am at a lost.

View Replies !   View Related
Local Machine Time To Eastern Time
How will we convert the system date & time to other timezone for eg: Eastern Time zone using ASP?

View Replies !   View Related
Time Function Returns Wrong Time
When the Form is submitted I use the Date() and Time() functions to put the date and time into the Body part of the e-mail. The time reported is three hours earlier than the time at which the Form is actually submitted.

I understand these functions are evaluated on the server so the server must be in a time zone three hours earlier than where I am . Is there any way I can get the local time at the location where the user is actually located. ?

View Replies !   View Related
How To Get Asp Execution Time And Database Connection Time ?
Any some tools or sample codes drop down asp script execute time and
database connection time ?

View Replies !   View Related
Server Time Local Time Convert
I'm trying to do a very simple code that converts the server time into a time zone of your choice.

dim h 'Current Hour
dim i ' Time Zone Increase - add or subtract hours
dim r 'Result Here
h = Hour(Now)
i = + 2
r = h + i

but obvisouly i'm having trouble with the time zone convert.

View Replies !   View Related
Compare The NOW Time With A Deadline Time
I am trying to compare the NOW time with a "deadline" time. Please help. Just not sure why this is not working. I need to be able to say IF IT'S BEFORE 9:30 TODAY, IT'S OKAY TO ADD SOMETHING. IF IT'S AFTER 9:30 TODAY, YOU MUST ADD IT TOMORROW.


deadlinetime=formatdatetime(now(),2) + " 8:30:00 AM"
response.write "NOW: " & nowtime & "<BR>"
response.write "Deadline: " & deadlinetime & "<BR>"
if nowtime<deadlinetime then response.write "can send out today" end if
if nowtime>deadlinetime then response.write "must send out tomorrow" end

NOW: 1/18/2007 8:51:43 AM
Deadline: 1/18/2007 8:30:00 AM
can send out today

As you can see, NOW is GREATER THAN Deadline, so it should must send out tomorrow.

View Replies !   View Related
Time Calculation :: Between Two Dates And Time
i want to calculate the total time between to dates and time.

Example: Total time elapsed from date 1 time 1 to date 2 time 2.

27/09/2004 11:00 - 28/09/2004 10:30

The user enters a record and then later comes back and closes it. I need to know the time it took from when they entered the record until the time it was closed.

View Replies !   View Related
Format A Name
I was wondering what would be the best function to format a name.
Say I have a function FormatName that takes in a string that is FRED SMITH and needs to return Fred Smith. The function basically needs to make sure the first character of each word is capitalized. What is the best way to do this?

View Replies !   View Related
CDO Format
how do you format an email in asp. For example: i want my email to read, The following customer has requested two tables then on the next line, it should provide customer's name then next line address and on and on.
Quote: Originally Posted by nschafer Or if you want a button instead of a link:

<input type="button" value="Close" onclick="opener.location='yourhomepage.htm';window.close(); ">

This will redirect the page that opens the popup as well as closing the popup.

View Replies !   View Related
Format Of URL
I must have the format of the below line wrong for IE:

click <a href="cal.asp?sdate=<% =strDate1 %>&location=<% =strLocation
%>&eTime=<% =strDate2 %>">here</a> to add this information to your

When I hover my mouse over the link, the status bar at the bottom of the
page for IE says: shortcut to 2006 11:00 AM
With Firefox I get: http://sd-school/forms/cal.asp?sdate=10/18/2006 10:00
AM&location=Library&eTime=10/18/2006 11:00 AM

The form works in Firefox, which is what I use for testing. So either the
format is wrong, or IE doesn't like the spaces or something. It doesn't
matter which dates I use, I get the same results.

View Replies !   View Related
At the moment I'm entering a new record in my database for every pageview (the record holds several things like IP, useragent..etc). I think this is asking too much of my database, and I get a lot of errors all the time.
Perhaps I should switch to entering each 'record' into a XML-file, and use that for my statistics? Any disadvantages, performance issues?

View Replies !   View Related
Saving CSV Format In Asp
i am encountering some problems in converting some data into CSV format..i have alreadi retrieve the data however i do not knoe of ani methods of converting to there ani method to save the directory to .csv

View Replies !   View Related
Format Date In Asp
Can someone help me with this request?

1. Data in my access database have the format "9/10 2005"

2. When I show all dates within an asp page I get the following format

The format I want to show in my asp page is the following format "9/10-05"

View Replies !   View Related
UK & US Date Format
My database (access) has a date field.

When I display the date through a recordset, it comes back in US format (mm,dd,yyyy)

How do you make it appear in UK format (dd,mm,yyyy)?

View Replies !   View Related
Email Format
I have a problem don't know how to write the attachment file frm mail....

<title>Thank you for reply with us.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%@ Language=VBScript %>
Dim strBody
Dim myElement

For Each myElement in Request.Form
Select Case Left(myElement ,3)
Case "txt","sel","rad":
strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & _
": "
if Len(Request.Form(myElement)) = 0 then
strBody = strBody & "UNANSWERED"
strBody = strBody & Request.Form(myElement)
end if

strBody = strBody & vbCrLf

Case "chk":
strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & _
": " & Request.Form(myElement) & vbCrLf
Case "are":
strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & _
": " & Request.Form(myElement) & vbCrLf
End Select

strBody = strBody & vbCrLf & strFooter

'Time to send the email
'Dim smtp
Set smtp = server.CreateObject("CDONTS.NewMail")

' set the mail properties
smtp.Subject = "ApplicationForm"
smtp.From = "ApplicationForm"
smtp.To = ""
smtp.Body = strBody

' fire off the email message
'Response.Redirect "thankyou.asp"

' check return value error code
'if objMail.errorCode = mmeNone then
' Response.Redirect "thankyou.htm"
' Response.Write ("Mail message was not delevered to the SMTP server." & "<br><br>")
' Response.Write ("Please try again later" & "<br><br>" )
' Response.Write ("The error code was :" & Cstr(objMail.ErrorCode) & "<br><br>" )
' Response.Redirect ""
'end if

' always destroy the object
' set smtp = Nothing

' Response.Write ("Thank you for advertising with us. We will revert to you soonest possible.")

' Response.Redirect strRedirectURL

<script language="JavaScript">
//set message:
msg = "Welcome To International Education Counsultancy";
timeID = 10;
stcnt = 16;
wmsg = new Array(33);
blnk = " ";
for (i=1; i<32; i++)
b = blnk.substring(0,i);
for (j=0; j<msg.length; j++) wmsg[i]=wmsg[i]+msg.charAt(j)+b;

function wiper()
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = str;
timeID = setTimeout("wiper()",100);

// -->
BODY { margin-top: 0.00in; margin-left: 0.0in;}

<body bgcolor="#FFFFFF" text="#000000">
<table width="75%" cellpadding="0" cellspacing="0" height="40%" align="center">
<td valign="middle" width="25%" height="288">
<div align="center"><img src="" width="576" height="198"></div>

View Replies !   View Related
Format E-mail
I use an ASP mail object to send orders filled online to a recipient via an e-mail. I would like to know if it's possible to format the way the order looks in an e-mail? I tried the following, but see no change in the format:

H1 = "<b><font size=2 color=#ED171F face=Verdana, Arial, Helvetica,
sans-serif>Order Type:</font></b>"

StrBody = H1 + Request(OrderNum) + vbCrLf

Then I get Order Type: just as plain as it would come if it didn't have any formatting.

If I do the following:

StrBody = "<b>Order Type:</b> + Request(OrderNum) + vbCrLf

Then I get <b>OrderType:</b> as the heading.

Does anyone know if it's possible to format the way the text look in an e-mail that is sent using the ASP Mail Object? Is there a different way of controlling the format/appearance of the text that appears in an e-mail?

View Replies !   View Related
Format Display Rss.xml With Asp
I've looked over the last 2000 posts for info on incorportating an RSS feed on a web page using ASP to control the display - especially which elements are shown and how many items are shown. I found a free ASP script that I hoped would do the job >>>

View Replies !   View Related
Asp To Excel Format
<%Response.ContentType = "application/"%>

which save my asp query to excel, but the TYPE of excel it saves as is WEB PAGE. is there a way to save as a excel workbook?

View Replies !   View Related
Format Paragraph
I've had some excellent help before on this forum and hoping for some more.
This is probably very basicbut I'm kind of muddling along a bit and it's a miracle I got so far.I have a memo text field in a table form and I'm wanting to enter text into it but all a small amount of formatting. Just basic paragraph breaks would be a start. This is kind of following on from a previous post of mine where I was trying to include line breaks. This was the solution.

<textarea name=whatever WRAP="HARD">

View Replies !   View Related
Date Format..
got anyone know wat is the code for
date format?i need to display the next 3 days's date as default value

View Replies !   View Related
Format Of Google
I have some pictures in i am printing it using response.write in one page.It is working properly.I want to print it in such away(it should follows google page)like every page it should print 2 and then another page.

View Replies !   View Related
Format Currency In ASP?
Is there an easy way to format a number into a currency display style eg:

I have this set in my Access database on the field but my asp produces:

Is there perhaps a formatCurrency command or something like that in ASP?

View Replies !   View Related
Html Format
can anybody help me out?what i need to do is -- upload a .doc file to an
html format so that the formatted text is not changed.

View Replies !   View Related
Format Number
I am trying to create a form and I have looked on the forums and couldn't find anything like this.

I want to convert example S.S. number from this

to this

How can I do this in ASP?I tried a replace function but doens't work or I have it completely wrong format

View Replies !   View Related
Datetime Format
In one of my asp webpage,i am fetching the data from a XML file and which indeed is fetching data from mySql database.

Now the date time format i am getting in from XML is "Wednesday, October 24, 2007, 2:03:42 PM" and when i display that time in my asp webpage then it shows like
"Wed, 24 Oct 2007 19:03:42 +0000"

View Replies !   View Related
SAS (?) Date Format
I'm currently building a form and I'm attempting to take the date and convert it into the same format as an unformatted date in Excel. I believe it's called SAS.
Is there any way to format a date into this format using excel?

View Replies !   View Related
Format Dropdown Bot
How would I format this dropdown box to uppercase and where would I place the UCase syntax?

<SELECT name="txtSearchCity" class="form">
Do while not Rs.EOF
<option value="<%=Rs("Addr City")%>"><%=Rs("Addr City")%> </option><%=Rs("Addr City")%>

View Replies !   View Related

Copyright 2005-08, All rights reserved