datetime

Drupal Views how to filter items overlapping a date range

Hi, in Drupal I have used CCK to add a datetime field to my custom data type. It inserts start date and end date fields. That is what I want. Now, I want Views to filter and show only the items that have the daterange (start date and end date) overlapping today's date. Any ideas on how to set it up on Views? What I think is strange is th...

how to convert server datetime to client machine datetime for the website.

I have datetime fieldI have datetime field into the database which stores the universal time i.e. UTC time. I want to show the datetime at the client machine in clients time zone and format. Example: Someone from US updated the database field for a site and it is stored into the UTC format. Someone from India goes and sees the site . Wh...

Converting string to datetime

I'm trying to enter a date in a mysql table `ssdate` datetime The function that produces the date can output it in 3 formats: 1276142400000 Thu Jun 10 00:00:00 GMT-0400 2010 Fri Jun 4 2010 I'm wondering which of these would be easiest to convert to this field format? Since I'm trying to save only the date, is there a better option...

Parsing timestamp with Python2.4

I want to parse a timestamp from a log file that has been written via datetime.datetime.now().strftime('%Y%m%d%H%M%S') and then compute the number of seconds that have passed since this timestamp. I know I could do it with datetime.datetime.strptime to get back a datetime object and then compute a timedelta. Problem is, the strptime f...

MySQL Datetime <-> Java Date

Hello! I use Hibernate and I have a datetime in my MySQL database. Now I want to store the date/time which is a java.util.Date into the database. So I can write: SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); testObject.setCreationDate(df.parse("2010-06-06 13:20:15")); But how can I set the current date/time? Bec...

Loading an XML file with todays date in the filename... need to fallback to old file if one with todays date doesnt exist..

So here is my question. Using javascript/jQuery I am currently loading in an XML file that has a file name such as carousel_large_2010-06-08.xml.. the way I am doing it is checked for todays date then grabbing a file that has that date in the filename... the issue is sometimes they wont be uploading a new file for a given day so it needs...

Ultrawingrid - how to display #1/1/1800# as blank ( as if null )

Ultrawingrid 9.2 VS2008 .net 3.5 My wingrid uses a bindingsource. All datetimes which are null in SQL Server are delivered to the bindingsource as #1/1/1800# I would like Ultrawingrid to display this date as blank as it would a null from source. Also, if the date is null in the grid ( i.e. blanked out ) I would like to update the dat...

Rails error when using %d (deprecated) on translating dates, what should i use instead?

in language file es.yml i have time: formats: short: "%d %b %H:%M" when i try using it like: <%= l my_object.created_at, :format => :short %> it shows the following error ActionView::TemplateError (missing interpolation argument in "%{count} %b %H:%M" ({:object=>Fri, 11 Jun 2010 09:00:00 CDT -05:00} given)) o...

How to check or validate the textbox entered date is in DD/MM/YYYY format?

How to check or validate the textbox entered date is in DD/MM/YYYY format? ...

converting a UTC time to a local time zone in Java

I know this subject has been beaten to death but after searching for a few hours to this problem I had to ask. My Problem: do calculations on dates on a server based on the current time zone of a client app (iphone). The client app tells the server, in seconds, how far away its time zone is away from GMT. I would like to then use this i...

JODA time in Java Appengine

Has anyone gotten JODA time classes to work on Google Appengine? I'm using 1.3.4 of the java sdk and I get the following error when trying: java.lang.NoClassDefFoundError: com/google/appengine/repackaged/org/joda/time/DateTimeZone I've imported it as well: import com.google.appengine.repackaged.org.joda.time.DateTime; ...

SQL Reporting Services 2005 - Date field based on a user entered date?

Hi, I have a report in report services 2005 that has two date fields. The problem is that if users run this for a large section of time it uses too much resources on our server. It is possible to only allow the end user to enter the start date and then the end date be auto populated/derived from this field (for example they enter the 1s...

Django date filter: how come the format used is different from the one in datetime library ???

Hello ! For formatting a date using date filter you must use the following format : {{ my_date|date:"Y-m-d" }} If you use strftime from the standard datetime, you have to use the following : my_date.strftime("%Y-%m-%d") So my question is ... isn't it ugly (I guess it is because of the % that is used also for tags, and therefore is ...

Why doesn't SQL Server have a pure date and pure time data type?

I have a few SQL Server tables with a datetime field that really only has to contain dates... and the fact that it's a datetime object violates data integrity, because it's possible for data to be inserted with a time - which isn't really valid for this field. The result is that we have to convert it and strip off the time every single t...

Oracle Age calculation from Date of birth and Today

I want to calculate present Age from Date of Birth in my oracle function. for that i am using (Today-Dob)/30/12. But this is not accurate as some months will have 31 days. I want to get the correct date with maximum precision How ca i do that?? ...

Format datetime timezone

I have a DateTime object. I want to return a String formatted as this one below: Thu, 06 June 2010 16:00:00 +0200 This is my code so far: DateTime.Now.ToString("ddd, dd MMMM yyyy HH:mm:ss zzz"); Result: Thu, 10 Juni 2010 18:33:14 +02:00 Is there a built-in way to get the timezone difference formatted without : ? (without m...

DateTime from Javascript post to Controller in ASP.NET results in null (01/01/0001)

This is driving me crazy, similar to this. If I use a standard form and no javascript the controller correctly binds the datetime. However when I'm posting from a form it always binds as null: "MyObject.Name": "Test name", "MyObject.Date": "5/1/2001" I've tried a couple of variations, 5-1-2001, etc. but cannot seem to get it to take....

Aribitrary System.DateTime to four character military time string

Hello, How would I convert an arbitrary System.DateTime to a four character military time string. Example 1: 7am would be "0700" Example 2: 2pm would be "1400" Thanks! ...

MySQL delete row after 'expiry'

Hi, I am trying to delete expired entries in a MySQL database, on creation or update a field called lastBeat is updated with CURRENT_TIME and I use the following query to check/delete rows older than 20 seconds: DELETE * FROM rmachines WHERE lastBeat < (NOW() - 20); I have also tried CURRENT_TIME instead of NOW() There are 2 ma...

IE JavaScript date parsing error

Hi, Why cannot IE parse this string as a Date object. var d = Date.parse("Fri Jun 11 04:55:12 +0000 2010"); // returns NaN However, it works well in FireFox. I am running IE 8. Thanks. ...