HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
total days calculation
Post new topic   Reply to topic    HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
cloudy



Joined: 21 May 2007
Posts: 7

PostPosted: Wed May 23, 2007 4:40 pm     total days calculation Reply with quote

hi, i m new in this forum, i hope can get some help on my problems.
i have 3 field like:
start date,end date and total days.
i not sure which way is good to get the total days?i need to get the total days from the user entered the value or i calculate my total day at the backend?count the datediff between the start and end date?
if the user wan to apply half day leave, hw it work?how the start date and end date can count the half day.?is it possible?
reallyblur on it. Question
hope to get from u all soon.urgent... Exclamation
plz help ya.
thank you. Wink
degsy



Joined: 23 Feb 2005
Posts: 2440
Location: North East, UK

PostPosted: Fri May 25, 2007 4:04 am     Reply with quote

You can use the DateDiff and DateAdd functions

Code:

<%
sd = "21/05/2007 9:00 AM"
ed = "26/05/2007 4:30 PM"

d =  DateDiff("d",sd,ed)
Response.Write "Days: " & d & "<br>"
sd = DateAdd("d",d,sd)

h = DateDiff("h",sd,ed)
Response.Write "Hours: " & h & "<br>"
sd = DateAdd("h",h,sd)

m = DateDiff("n",sd,ed)
Response.Write "Minutes: " & m
%>
cloudy



Joined: 21 May 2007
Posts: 7

PostPosted: Sun May 27, 2007 4:21 pm     calendar-days calculation Reply with quote

hi there,
i jz get the date from the calendar. didnt get the time.how can i get the time and cont with the process?
thank you.
cloudy



Joined: 21 May 2007
Posts: 7

PostPosted: Thu May 31, 2007 8:57 pm     Reply with quote

hi there,
thanx for ur kind response.i have solve it eoldi..
thank you very much.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> ASP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial