date

How to get the duration of days from today to a specified date in javascript?

Suppose the specified date is 2010-11-9, how to get the duration programatically? ...

Rails and created_at

Hi all! I do: Order.find(:all, :conditions => "created_at>='#{DateTime.now.year}-#{month}-1' and created_at<='#{Date.new(DateTime.now.year, month.to_i, -1)}'") That is working fine except that everything created on the last day of the month is not included. Created_at might contain: "2010-09-30 18:34:09". That is NOT less than or equ...

javascipt utility that increments/decrements to the next 15 minute interval

Can anyone find any bugs or performance improvements here? <a href='#' id='from_arrow_down' onclick="timeOffset(-1,'from_time');">Click me</a> function timeOffset(offset,time_id) { // javascipt utility that increments/decrements to the next 15 minute interval. // When user pushes a button, program will get time from input box, ...

Converting a string into a Date via javascript

I have a string I need converted into a date: 2010-10-14T09:00:00.0000000 In FF and Crome I can do var date = new Date("2010-10-14T09:00:00.0000000") and everything works. That code in IE, Safari and Opera gives be a NaN. How can I get that string into a date in a x-browser manner, preferably without manually parsing the string into i...

How to parse e.g. 2010-04-24T07:47:00.007+02:00 with Python strptime

Does anyone know how to parse the format as described in the title using Pythons strptime method? I have something similar to this: import datetime date = datetime.datetime.strptime(entry.published.text, '%Y-%m-%dT%H:%M:%S.Z') I can't seem to figure out what kind of timeformat this is. By the way, I'm a newbie at the Python langu...

Java Format Detailed Difference Between Dates

I'm sure this has been asked before in some other way that I just can't find, so I apologize upfront for repeating if I am. I am trying to calculate the difference between two dates and then display that difference in days, minutes, and seconds; something like "3 days 23 minutes and 59 seconds" Very easy, I'm sure, but I'm a C# guy by ...

Maximum time() | PHP

It's kind of a silly question, but what would be the maximum INT value of a time() and it's future date, e.g. 1st January 2999 Would time() ever get to that value? Going for a large time() value would return this: Thu 1st Jan 1970 1:00AM A normal int date 1287320788 - outputs today's date: Sun 17th Oct 2010 2:06PM But ...

How can i draw a graph with Date Axis using c++ and zedgraph

I have successfully used the c++ example project to draw graphs from my c++ project using zedgraph. However there is no example with Date axis for c++. The following code is taken from the c# example found here http://zedgraph.org/wiki/index.php?title=Tutorial:Date_Axis_Chart_Demo. Please see my comments with the text //JEM// to see wh...

How to a convert a date to a number and back again in MATLAB

I have the date 1/11/2010 and use the function = date(year(A1),month(A1),day(A1)) to convert the date to the number to 40189 with Excel. Can I use MATLAB to convert the number 40189 back to the date again? ...

Convert.ToDatetime not adding timestamp

For example: Dim testdate As String = "29/10/2010" testdate = Convert.ToDateTime(testdate.ToString) Response.Write(testdate) expecting "29/10/2010 00:00:00" what I get is "29/10/2010" ...

Setting dateTime.ToString() format centrally

How do i set the DateTime format centrally so that at any time if I use a dateTime.ToString() in my code I get string in the ISO format(eg:2008-2-19 01:00:00) ...

Help getting GB - US date conversions working in asp.net vb

My site is set to en-GB in the web.config. I have a calendar extended textbox control on a page which lets the user select date, in GB format as string (DD/MM/YYYY). I need to convert this to a US datetime before inserting into db. solution: (MM/dd/yyyy hh:mm:ss) I do hate mondays. Overthinking as usual. ...

Android difference between two dates in seconds

I've tried different methods around the web but couldn't make it work. Cursor cursor = sqlite.myDataBase.rawQuery("SELECT StartDate, EndDate FROM Tracks Where Id="+'"'+trackId+'"',null); SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date startDate = outputFormat.parse(cursor.getString(cursor.getCol...

Javascript timer counting down between two php dates

Hi All, I am building a timer for a website that will count down between two php date()s. The whole site uses php and there are a lot of time/date functions which rely on date_default_timezone_set() etc. So, back tot he timmer... I can get it working, well if I refresh my screen every second, the problem I currently have is the date/t...

I'm having problems using dates in Android

I am trying to compare dates and I have found where my code goes wrong, but I don't know why. I am trying to compare a date with todays date (using Gregorian Calendars only). I have printed out todays date where ever it is mentioned in the code and in one place it magically changes from year 2010 to year 3910 (todays year + 1900). Doe...

Need two Date() values for Java task

This is a really simple request, but I am not quite sure the easiest/most efficient way of generating these two values. I need to write a script that will check whether a given value is between two values. I am well aware of how this is done in SQL. The way I need the values is somethign similar to the following. Date testValue = ne...

Drupal date formatting

In lieu of using php's date() function directly, I'd like to trigger a date format that I've created at admin/settings/date-time/formats. At first glance I thought I could do this: format_date(strtotime($date), 'customformat'); But it looks like format_date() has a few formats hard-coded and doesn't communicate with the date/time for...

Python Visual Basic's CDate equivalent

I used to have this code in Visual Basic: rpt.ParameterFields.GetItemByName("RowDate").AddCurrentValue CDate("2010-03-19") and I cannot figure out into what I have to convert date to make eatable for COM. Any suggestions? ...

how do you make plots with dates in matlab?

Possible Duplicate: Plotting data on time (date) axis in matlab hi, I have 2 column vectors in matlab (I imported the data from excel). the first one is called textdata which contains a list of dates and times as string format: textdata = '1/11/2010 11:40:04 AM' '1/12/2010 11:40:04 AM' '1/13/2010 11:40:04 AM' the ...

Problem with short date format in php

Hi, I have problem with date function in php. If I supply string in format "d.m.y" for example "01.01.01" it gets rendered as todays date which means that php gets confused. I found: Note: The "Day, month and two digit year, with dots or tabs" format (dd [.\t] mm "." yy) only works for the year values 61 (inclusive) to 99 (...