Project TIME calculated, in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tImeArrived = CDate(InputBox("Enter START time:", "Start time", "9:00 AM"))
TimeLeft = CDate(InputBox("Enter END time:", "End time", "1:24 PM"))
Minutes = DateDiff("n", TimeArrived, TimeLeft)
Hours = Int(Minutes / 60)
Minutes = Minutes - (Hours * 60)
TotalTime = Format(Hours, "0") & ":" & Format(Minutes, "00")

I did something like this in VBA, but I want to create something for PHP.

How can  extract an am or pm from the input string, convert to 24 hours for
calculations, then convert back to 12 hour am/pm format in PHP?


I want to be able to put 9:00 am as Time Arrived, and 1:00 PM as Time Left,
then it puts in the subject the total time i worked on X project.

IN VBA thier is time diff function, how do I create something like that that
will create a email message, that is then sent to a suplied email, (i.e. our
ticket system).

Basically I want to transform my VBA code to PHP, so I can run a similar
idea on my Blackberry so other technicians in our office can send a proper
email on a blackberry while on call in the road.



This is what I did in VBA

" Dim OutlookMessage As Outlook.MailItem
Set OutlookMessage = Application.CreateItem(olMailItem)
MsgBox ("Welecome To Support Email")
custname = InputBox("Enter Cust name ", "Enter Cust Name", "Put Cust Name")
job = InputBox("Work done", "Work", "Short Discrption")

TimeArrived = CDate(InputBox("Enter START time:", "Start time", "9:00 AM"))
TimeLeft = CDate(InputBox("Enter END time:", "End time", "1:24 PM"))
Minutes = DateDiff("n", TimeArrived, TimeLeft)
Hours = Int(Minutes / 60)
Minutes = Minutes - (Hours * 60)
TotalTime = Format(Hours, "0") & ":" & Format(Minutes, "00")


OutlookMessage.Subject = custname & ": " & Date & "  " & job
OutlookMessage.To = "blah@xxxxxxxx"
OutlookMessage.CC = "blahcc@xxxxxxxx"
OutlookMessage.Body = custname & " " & Chr(13) & Date & Chr(13) & "A: " &
TimeArrived & Chr(13) & "E:" & TimeLeft & Chr(13) & "Total: " & TotalTime &
" " & Chr(13)

-- 
"
THanks
Justin
IT-TECH

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux