dates

Equivalent of Excel’s NETWORKDAYS function with Jet ADO

Excel's NETWORKDAYS function returns the net working days between two dates. Is there a way of replicating this when connecting to a Jet database via ADO? ...

List of all months and year between two dates in PHP

Hi everybody, i need a help. I am explaining at details so that easy to understand. I want a list of month and year based on the difference of month and year. I am implementing search functionality based on Start month with year and end month with year. So start Selection - 01(month)-2009 (Yr) End selection 10(month)-2009 (Yr) so i ...

Useful extension methods C# library for the Date object

Could you guys recommend me a library which handles the most common missing features for the Date object in C#? .. Things like figuring out: What quarter a given date is in Get the start/end of a given quarter/month/week Various subtraction -and addition methods Note: A library which implements its features as extension methods woul...

Determine the number of months between two dates using Cocoa

Hello, How do I calculate the number of months between two dates using Cocoa? Thanks, Stan ...

Calculate the start-date and name of a quarter from a given date

How can I find the start-date and name (1, 2, 3, etc.) of a quarter from a given date? ...

How can I calculate/find the week-number of a given date?

How can I calculate/find the week-number of a given date? ...

Javascript: Adjust date in textbox using keypress event

I have a standard <input> textbox where users enter a date. I'd like to add some functionality where users can enter + or - to add/subtract a day from the value. I added an onkeypress event that calls this function: function adjustDate( element ) { var e = event || window.event; var code = e.charCode || e.keyCode; switch( ...

Wrong timezone being used in Java web service

I have a JAX-B java web service which I'm using to update a database. Each row in the table that I'm updating is represented by an object similar to below: - public class Item { private String id; private Date startDate; private Date endDate; public Item() { } ... } This class is being instantiated in a separate...

SQL query in SQL SERVER 2005 - Comparing Dates

I'm having a hard time doing this query. I want to compare dates in my query, dates from my DB are in this format: (MM/DD/YYYY HH:MM:SS AM) I want to compare this date with tomorrow's day, today plus one. My questions are: How do I declare tomorrow's date in sql server? How would you compare these two dates? Thank you!! =D EDIT : DATE...

JQuery datepicker- 2 inputs/textboxes

Two input boxes: when I set the first one, I want the second one to be be one day after the date selected in the first. I am using Keith Wood's jquery plugin: http://keith-wood.name/datepickRef.html. Using altField: just keeps the same in the two fields, but I want to get 1 day after in the second input field. ...

Set Zend_Date Month using User Input

I'm looking for a way to set the month of Zend_Date using a string from the user (could be Jan, January, etc). For example $month = strftime("%m", strtotime($month)); $date->set($month, Zend_Date::MONTH); Will get the month 'number', which then can be used to set the Zend_Date month. Is there a way to do that all with Zend_Date? ...

Hashing-algorithm for dates

What would be a good hash-algorithm to hash dates, e.g. 24/12/09 and 31/10/89? The dates would range from about year 1950 to 2050. Could using the unix timestamp somehow, be possible? ...

How can I use Perl to do datetime comparisons and calculate deltas?

I extracted year, month, day, hour, minute, second, and millisecond data from human readable text (it wasn't in a timestamp format, but rather something like "X started at HH:MM:SS.SSS on DD MMM YYYY and ended at HH:MM:SS.SSSS on DD MMM YYYY"), so for each recorded event, I have each of the values. However, I need to turn those into som...

how to know if between 2 date's it past 5 days - Oracle 10g ?

I have two date's: 1) 01/05/2009 2) 06/05/2009 How can I know if there's 5 days between them? ...

"Date of birth" validation: How far/much would you go?

I'm quite anal about form validation. So while creating a validator for a "data of birth" (DOB) field in one of my current projects for a job application form (platform/language is neutral in this context), I wanted something to prevent 'punky' inputs. I used a date picker and restricted the max date to be XX years from the current day....

C# lists - sorting date problem

Hello, I have a C# list collection that I'm trying to sort. The strings that I'm trying to sort are dates "10/19/2009","10/20/2009"...etc. The sort method on my list will sort the dates but the problem is when a day has one digit, like "10/2/2009". When this happens the order is off. It will go "10/19/2009","10/20/2009","11/10/2009","11...

C#: Calculate difference between two dates (number of days)?

I see that this question has been answered for Java, Javascript, and PHP, but not C#. So, how might one calculate the number of days between two dates in C#? ...

Calculate the first day of a calendar week [C++]

I need to calculate the date of the first day in a calendar week, e.g. Week 1 in 2009 -> Mon, 29.12.2008 (!) Week 44 in 2009 -> Mon, 26.10.2009 I have some ugly code for this, but I would prefer a nice C++ lib. Any suggestions? Thanks. ...

Searching on date ranges with Lucene in Java ?

Is it possible to search on date ranges using Lucene in Java? How do I build Lucene search queries based on date fields and dates ranges? For example: between specified dates prior to a specified date after a specified date within the last 24 hours within the past week within the past month. [Edit] i'm using Lucene 2.4.1 and my syste...

Calculate two dates with PHP?

I have two dates in the format below: Start Date = 30-10-2009 End Date = 30-11-2009 How, with PHP could I calculate the seconds between these two dates? ...