Re: Project TIME calculated, in PHP

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

 



On 1 May 2010 18:48, justino garcia <jgarciaitlist@xxxxxxxxx> wrote:
> 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?
>

$Start_AM_PM = date('A', strtotime($_POST['StartTime']));
$End_am_pm = date('a', strtotime($_POST['EndTime']));

http://docs.php.net/manual/en/function.date.php
and
http://docs.php.net/manual/en/function.strtotime.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
>



-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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