date

How to check if new Date("some date") was able to parse correctly?

I have the following code, which is supposed to try to parse a given date. If it fails, it defaults to the current date: var date = new Date(textbox.value); // Try to parse if (isNaN(date)) date = new Date(); // Default to current Now i'm using isNaN() to test if it was able to parse correctly, eg to check that new Date() didn't retu...

How to check if a date is in a list of dates - TSQL

I am trying to create a SQL query that checks if a date is in a list of dates but my query doesn't work... SELECT * FROM TABLE1 WHERE field1 = value1 AND convert(nvarchar(15),date_start,101) IN (SELECT convert(nvarchar(15),date_end,101) FROM TABLE2 ) This query should return some values but it doesn't......

Fullcalendar: back to selected date after postback

Hello! This question about jquery plugin fullcalendar. How I can return to selected date after postback?.. For example, i have week agenda as default view. Assume I choose next week (custom week) and create the event in it. After postback I return to default week, but I want get custom week. How can be resolved this issue?.. Please he...

jQuery tools date time picker

Hi everyone, can anyone recommend me some jQuery tools date time picker, on official jQuery tools site there is only date picker but I am looking for plugin that has time extension. Thanks a lot. ...

PHP - Extracting weeks/days/hours/minutes from a date calc.

$dateDiff = $mtime - $ctime; $fullDays = floor($dateDiff/(60*60*24)); $fullHours = floor(($dateDiff-($fullDays*60*60*24))/(60*60)); $fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60); echo "Difference is $fullDays days, $fullHours hours and $fullMinutes minutes."; I am looking to add the ability to se...

Converting a time string to UNIX timestamp

Hi How can I convert a time string like this: 30/7/2010 to a UNIX timestamp? I tried strtotime() but I get a empty string :( ...

Relative time function in js for format YYYY-MM-DDTHH:MM:SS+0000

Hey, I was wondering if anyone knew how I could parse this type of date format: 2010-07-26T18:02:46+0000 into the relative time such as "30 seconds ago" I already have a function which does it for a similar but different time format: function relative_time(time_value, is_relative) { var values = time_value.split(" "), ...

Get Weekend Dates in php

Hi all, I am working on a php application which requires that I extract the dates of the weekends between two dates and then insert them as single records in the mysql database. I was thinking if there was a simpler way of doing it, rather than going through the loop between start date and end date and for each date checking if date('l...

Get date range between two dates excluding weekends

Given the following dates: 6/30/2010 - 7/6/2010 and a static variable: $h = 7.5 I need to create an array like: Array ( [2010-06-30] => 7.5 [2010-07-01] => 7.5 => [2010-07-02] => 7.5 => [2010-07-05] => 7.5 => [2010-07-06] => 7.5) Weekend days excluded. No, it's not homework...for some reason I just can't think straight today. ...

Date serial in SQL ?

How can I convert a day [1-31] and a month [1-12] and a year (all int), to a date serial IN SQL (without converting to varchar)? ...

date appears one day prior to what is programmed in JasperServer

I posted this on the JasperServer forums, but I've had better luck on StackOverflow generally. Please help if you can. My biggest single gripe about JasperServer is that it flat out behaves differently than JasperReport (specifically, jasperreports developed in iReport). The problem I'm seeing now is that dates are displayed as one day...

Delphi & ADO: datetime to string conversion

Hi, I use Delphi 2006 and ADO to connect to a MS Access database. Some of the fields I retrieve are Date fields (in Access formatted as "Medium Date" i.e. 20-Apr-2010) however I have to retrieve them as Strings: FValue:=FAccessADOQuery.Fields.FieldByName(FIELD_NAME).AsString; and then the fields are formatted as follows: 4/20/2010. ...

How to calculate person's age in months+days in PHP 5.2 ?

I have asked this question before and accepted the answer but now I found that the php version on our server is 5.2 and DateTime::diff() is not working on that. I want to calculate person's age in months plus days using date of birth and a given date. Date Format Input: Y-m-d (example: 1986-08-23) Output: 5 months and 20 days old. 15...

SimpleDateParser produces incorrect date?

Good morning! I've been working with the following bit of code for the last two hours, scouring forums, Google and the JDK 1.6 docs for any idea what is going on but can't seem to make this work. I would expect the code to output 07/25/2010 11:59:33 PM but what I get instead is 01/25/2010 11:59:33 PM . String dateString = "07/25/2010 ...

Rails ActiveRecord date parsing for i18n (specifically european date formats).

I'm working on a rails project for an Australian website. As a result, they want to be able to enter date formats in the more european-standard of 'dd/mm/yyyy' rather than the US-centric 'mm/dd/yyyy'. I have an ActiveRecord model with a Date field. I'm using jQuery's datepicker to provide the date select on a text field, and have it s...

Generating UTC Time in java

I want to get the UTC time for 01/01/2100 in Java to '2100-01-01 00:00:00'. I am getting "2100-01-01 00:08:00". Any idea, how to correct this. public Date getFinalTime() { Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); Date finalTime = null; tr...

Compare to dates Javascript?

Possible Duplicate: Compare 2 dates with JavaScript Hi, I'm working on form validation for my application and i want to know where i would be to start looking at to find date comparison eg a start date and an end date. The dates inputted in to my application are in the form: DD/MM/YYYY. Thanks in Advance, Dean ...

Need to get Saturdays date of the week in linux C

I am trying to get Saturday's date of the week in Linux C. Using the function time and localtime, I got today's date and time details. How to proceed further to get Saturday's date? #include <time.h> #include <stdio.h> #include <string.h> int main() { char date[20]; struct tm *curr_tm = NULL; time_t curr_time; curr_time = tim...

Check if Dates from List<Date> are following each other

Hello! I don't know if I described it correctly. I have several lists of dates in Java. Now I need to know when a list contains at least 4 dates that follow each other. e.g. "2010-06-27, 2010-06-28, 2010-06-29, 2010-06-30". I just need an idea where to start.... Thanks! ...

R heights graph - relative to birth date

I have a group of people, with a space-separated text file for each person. In these files, the right value indicates the height of that person in cm and the left value indicates the date in %d/%m/%Y format: 09/05/1992 0 17/03/1993 50 02/08/1994 65.5 03/12/1995 72 A height of 0 marks the birth date of the person. This R script draws ...