time

Why does DB2 CHAR() function return '24:00:00' for a time field that is 00:00:00?

I'm querying DB2 on i (AS/400). A plain SELECT statement on a column with datatype of TIME returns 00:00:00, but when I use the CHAR() function it returns '24:00:00'. I understand that 24:00:00 is a valid time, but why would CHAR() return 24 when the native TIME returs 00? ...

Rails, using time_select on a non active record model

I am trying to use a time_select to input a time into a model that will then perform some calculations. the time_select helper prepares the params that is return so that it can be used in a multi-parameter assignment to an Active Record object. Something like the following Parameters: {"commit"=>"Calculate", "authenticity_token"=>"e...

Formatting date times provided as strings in Django.

In my Django application I get times from a webservice, provided as a string, that I use in my templates: {{date.string}} This provides me with a date such as: 2009-06-11 17:02:09+0000 These are obviously a bit ugly, and I'd like to present them in a nice format to my users. Django has a great built in date formatter, which would do ...

Get current time and date

Hello, is there a crossplatform way to get current date and time in c++? Thanks. ...

How to get the time online from actionscript?

I need to be able to find the current time from an online source rather than the system to make sure the time is correct. I need to do this in actionscript, preferably 2 rather than 3 though if you have any solution at all post it. Thanks ahead of time for the help. ...

Asp.net Time Input Control Suggestions

Can anyone recommend a Time Input control for an asp.net web application? It should be able to handle the following items Am/Pm 24 Hour client side validation client side completion (if you start the hour with a 3 then jump to minute) one textbox (not separate textboxes for hours and minutes, or drop downs) ability to actually type ...

SQL AVERAGE TIME

I have the following query in MSSQL: select TRANSACTION_TYPE_ID ,COUNT(TRANSACTION_TYPE_ID)AS NUMBER_OF_TRANSACTIONS ,CAST(SUM(AMOUNT)AS DECIMAL (30,2)) AS TOTAL FROM [ONLINE_TRANSACTION] WHERE CONVERT(CHAR(8), CREATED_ON, 114) >='17:30' AND AMOUNT IS NOT NULL AND TRANSACTION_TYPE_ID !='CHEQUE-STOP-TRANS-TYPE' GROUP BY TRAN...

How do I get the exact time for a remote server in C#

In C#, how do I query a remote server for its current time? Similar functionality to net time \\servername but returning a datestamp that includes seconds. Thanks ...

How do I sum visits with an SQL query?

I am trying to filter an SQL database. Each row represents a user, the main column I’m focusing on is titled last_visited and formatted as… 2009-06-17 12:15:32. How many users have visited in the last day/week/month? Like in: SELECT COUNT(*) AS USERS_TODAY FROM parts_users Where updated_at > (NOW()-7) ...

Timestamp conversion is off by an hour

I'm trying to parse a twitter feed in django, and I'm having a strange problem converting the published time: I've got the time from the feed into a full 9-tuple correctly: >> print tweet_time time.struct_time(tm_year=2009, tm_mon=6, tm_mday=17, tm_hour=14, tm_min=35, tm_sec=28, tm_wday=2, tm_yday=168, tm_isdst=0) But when I call thi...

autoformat Time in TextBox ASP.Net Javascript

I need to format time like 10:00 PM or 12:23 AM in both 12 or 24 hour format using Javascript ...

Convert minutes into a week to time using Java's Date and Calendar classes

Overview This is the scenario: I'm given a value which represents a portion of the total number of minutes that exist in a standard week (assuming 10,080 minutes a week and 1,440 minutes a day) starting midnight Saturday (so 0 minutes Sunday @ 12am). I need to convert this minute value into an actual time value (like 8:35am) and I wan...

Timing User Access in ASP.NET MVC, Beginner

In ASP.NET MVC, what is a good way (the preferred way??) to time how long a user has been on a specific page? For example, I want the user to select something and then only allow the user to do something for 30 seconds. Good links or a reference to a page of a book would be much appreciated. Thanks in advance! ...

Why does ActiveRecord generated SQL includes Date for a Time column?

When I create a SQL Time column I get a pure time, ie. no date. But when I use the Ruby Time class I get a date as well. The problem is when do a 'find' the generated SQL includes a date and I seem to be getting weird results. The Table start_date: time end_time: time day_of_week: string ActiveRecord def self.now_playing self.fi...

Weird created_at behavior

I've set config.time_zone = 'UTC' in environment.rb, and yet still I get some weird behavior with Rails' built-in datetime fields: >> Time.now => Sun Jun 21 17:05:59 -0700 2009 >> Feedback.create(:body => "testing") => #<Feedback id: 23, body: "testing", email_address: nil, name: nil, created_at: "2009-06-22 00:06:09", updated_at: "2009...

Is it possible to monitor the time on a linux server from a .net app on windows?

I'd like to monitor the time on a couple of servers. Ideally I'd do this in an app running on a windows machine. Is this possible and where might I start? I know next to nothing about Linux. ...

Imprecise numbers with microtime and floating point addition in PHP

I'm having a terrible time convincing myself what I've done here is a good idea. The specific section I find objectionable is: return ((float)($now+$sec).'.'.$mic); In order to preserve the floating point precision, I'm forced to either fall back on the BC or GMP libraries (neither of which is always available). In this case, I've res...

PHP Time and Date

I have a database with dated articles. What I want to do is select articles between 2 dates - for example from 7 days ago to today. Can anybody help me. I have been trying to write a code for it but it hasn't worked for me. Thanks in advance ...

How do I use the bash time function from python?

I would like to use python to make system calls to programs and time them. From the Linux command line if you type: $ time prog args You get something along the lines of: real 0m0.110s user 0m0.060s sys 0m0.024s if you do a 'man time', it states that you can type: $ time -f "%E" prog args in order to format to get only...

How to perform date operations in hibernate HQL

Hello friends, I want to perform data time operations using hibernate hql. I want to add and subtract two dates as well as I want to subtract 1 year or 1 month from a particular date. How is this possible using HQL in hibernate. Does anyone know about it? is there any tutorial available for this? Please help if you can. Thanks. ...