Re: Quantity of time from difference of two Datetime values?
Thanks, Hank! I figured it was something like that, but couldn't see any clear documentation on the Oracle reference page on date/time functions. On Sep 30, 2011, at 8:22 PM, Hank wrote: > n Fri, Sep 30, 2011 at 11:08 PM, Jan Steinman wrote: >> Okay, I've reviewed the online man page for date and time functions, and >> I've played with several likely candidates, and I am still having trouble >> subtracting two arbitrary Datetimes to get something that is useful. A >> simple subtraction yields the least useful thing possible: a modulo-100 >> difference of modulo-60 quantities. Other functions yield the proper answer, >> but not for a quantity of time that rolls over midnight, etc. >> >> Surely, there are tons of payroll apps that subtract the punch-out from the >> punch-in to come up with a quantity of time? >> >> What is YOUR favourite way of coming up with a quantity of time as the >> difference between two arbitrary Datetimes? Did I overlook something simple? >> Do I need to convert the two to scalar integers first? > > > See the unix_timestamp() function. Converts date/times to a scalar > integer of the number of seconds since the Unix Epoch. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Quantity of time from difference of two Datetime values?
2011/09/30 20:08 -0700, Jan Steinman Okay, I've reviewed the online man page for date and time functions, and I've played with several likely candidates, and I am still having trouble subtracting two arbitrary Datetimes to get something that is useful. A simple subtraction yields the least useful thing possible: a modulo-100 difference of modulo-60 quantities. Other functions yield the proper answer, but not for a quantity of time that rolls over midnight, etc. You mean timestamps that are less than a full day apart? "TIMESTAMPDIFF(SECOND, ...)" does not work for you? There is also "TO_SECONDS". -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Quantity of time from difference of two Datetime values?
n Fri, Sep 30, 2011 at 11:08 PM, Jan Steinman wrote: > Okay, I've reviewed the online man page for date and time functions, and I've > played with several likely candidates, and I am still having trouble > subtracting two arbitrary Datetimes to get something that is useful. A simple > subtraction yields the least useful thing possible: a modulo-100 difference > of modulo-60 quantities. Other functions yield the proper answer, but not for > a quantity of time that rolls over midnight, etc. > > Surely, there are tons of payroll apps that subtract the punch-out from the > punch-in to come up with a quantity of time? > > What is YOUR favourite way of coming up with a quantity of time as the > difference between two arbitrary Datetimes? Did I overlook something simple? > Do I need to convert the two to scalar integers first? See the unix_timestamp() function. Converts date/times to a scalar integer of the number of seconds since the Unix Epoch. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Quantity of time from difference of two Datetime values?
Okay, I've reviewed the online man page for date and time functions, and I've played with several likely candidates, and I am still having trouble subtracting two arbitrary Datetimes to get something that is useful. A simple subtraction yields the least useful thing possible: a modulo-100 difference of modulo-60 quantities. Other functions yield the proper answer, but not for a quantity of time that rolls over midnight, etc. Surely, there are tons of payroll apps that subtract the punch-out from the punch-in to come up with a quantity of time? What is YOUR favourite way of coming up with a quantity of time as the difference between two arbitrary Datetimes? Did I overlook something simple? Do I need to convert the two to scalar integers first? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Antwort: difference of two datetime values
On 16.02.2001 13:27:58 Vyacheslav Chukin wrote: > Please, tell me, > how could I determine, > which one of two datetime values is greater? Date1 < Date2 > In other words, > how could I determine, > is stored on db datetime value in future or past? Past: DbDateTime < NOW() Present: DbDateTime = NOW() Future: DbDateTime > NOW() > Before posting, please check: >http://www.mysql.com/manual.php (the manual) ^^ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: difference of two datetime values
select if(columnname > now(), "future", "past") from tblname On Fri, 16 Feb 2001, Vyacheslav Chukin wrote: > Please, tell me, > how could I determine, > which one of two datetime values is greater? > > In other words, > how could I determine, > is stored on db datetime value in future or past? > > Best regards, mailto:[EMAIL PROTECTED] > Vyacheslav Chukin > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
difference of two datetime values
Please, tell me, how could I determine, which one of two datetime values is greater? In other words, how could I determine, is stored on db datetime value in future or past? Best regards, mailto:[EMAIL PROTECTED] Vyacheslav Chukin - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php