date

Warning: date() expects parameter 2 to be long, string given in

Hello i got this error its the $birthDay = date("d", $alder); $birthYear = date("Y", $alder); i dont know what it is here is my code //Dag $maxDays = 31; $birthDay = date("d", $alder); echo '<select name="day">'; echo '<option value="">Dag</option>'; for($i=1; $i<=...

Efficiently keep records of each change to some Core Data relationships

I'm designing a Core Data app which needs to keep dated records. Imagine a user works with the program for a while and some records are stored. The user then changes important attributes and relationships (which transcend individual records), and continues using the program with this new configuration. Imagine now that the user looks ba...

MySQL Date Between Subquery Question

Ok, I have a subquery that I am trying to work with and was needing a complicated question answered. There is a SQL tool that is being used to generate reports. With this tool, you can select dates as long as the date is in the outer select statement. So, you can use this tool to select a date range for instance from a simple select stat...

query multiple date ranges for a certain date range

hello, i have the problem with MapReduce and complex date ranges: i have database entries like this: { name: x, ranges: [ {from: 2010-1-1, to: 2010-1-15}, {from: 2010-1-17, to:2010-1-20}, ] } ... now i want to query which documents fit into the range: 2010-1-10 to 2010-1-18. i am totally stuck on this because every couchdb exampl...

Check if a given date is past

I have a week calendar that holds events, and want that users can't add events for the past days. So I'm tring to use a function like that: if( strtotime($this->day) < time() ){ // date format is YYYY-MM-DD // date is past }else{ // date is not past } It seems to works fine, except that it consider today date as a past day. What a...

Time within a particular time interval

i'm trying to solve a seemingly simple problem, but just can't quite get my mind around it. i have two times startTime and stopTime, which can be considered to be in the format: hh:mm:ss [24hr format]. Now given a third time - timeToTest - i need to find out if timeToTest lies between startTime and stopTime. There is no date informati...

How to get first day of every corresponding month in mysql?

Hi, I want to get first day of every corresponding month of current year. For example, user selects '2010-06-15', query demands to run from '2010-06-01' instead of '2010-06-15'. Please help me how to calculate first day from selected date. Currently, I am trying to get desirable using following mysql select query:- Select DAYOFMONTH(...

Date picker in Android

Hai, Can any one post sample code for a simple date picker in Android. If date picker is not possible in Android, an option to choose a date is needed. Thanks in Advance.. ...

XML Schema: comparing to date elements

I have an XML file like this: <?xml version="1.0" encoding="UTF-8"?> <items> <item id="1"> <valid_from>2010-07-09</valid_from> <valid_to>2010-07-12</valid_to> </item> <item id="2"> <valid_from>2010-07-09</valid_from> <valid_to>2009-07-12</valid_to> </item> </items> Is it possible to defi...

Add 1 Week to a Date, which way is preferred?

I am reviewing some code at work and came across an inconsistency in how the code handles adding 1 week to the current time and was wondering if there was any reason why one should really be preferred over the other: The first was a utility method: public static Date addDaysToDate(final Date date, int noOfDays) { Date newDate = new...

How do you stop javascript assigning objects by reference?

I'm using the date.js library. Previous code: alert(incidentDate); var deadlineDate = incidentDate; deadlineDate.add(2).years(); alert(incidentDate); return; Adding to the deadlineDate caused the incidentDate to change too. A bit of reading revealed that this was because objects in javascript are always assigned by reference. I've fo...

Need to query "order date" larger than "filled date" any suggestions?

I have a query with over 500,000 rows of data in the output. I need to filter the criteria down so that I am comparing column "order date" to column "filled date". I want to find all orders with a filled date sooner than an order date (yes, that sounds backwards). Is there an easy way to query this in design view? I am not very good with...

Extracting yyyy/MM/dd formated date from datetime datatype in T-SQL

I have my date values in postdate column in articles table in sql database table. It stores all date as well as time. I would like to get the date part only. i.e from 2010/07/01 12:45:12 i would likfe to get 2010/07/01 in my view ...

Date.js culture info is confusing me

I'm including date.js (from datejs.com) and the en-IE culture info script. If I call alert(Date.CultureInfo.dateElementOrder) I see the correct dmy, but if I try to interpret the date 02/03/01 I get 3 Jan 2001 and not 2 Feb 2001. I'm not sure whether this is a bug in date.js or a problem with me. ...

how do i set the time in php?

<?php date_default_timezone_set("Spain/Madrid"); $date=date("H:i:s"); echo $date; ?> how can i set the date to my location? i get this when i run the script Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID 'Espana/Madrid' is invalid i know Spain/Madrid is not recognized, but how can i fix it? ...

Causing timer to reset to specific amount only after xxx time remains (PHP)

I have a php script I'm trying to alter. The original code is written to increase the countdown timer by a value pulled from SQL anytime a button is pressed. What I've been trying to do is change the code so that the time doesn't increase but actually resets to a specific remaining time ONLY WHEN the timer is under a certain amount (sa...

Rails: Don't save date if it wasn't changed

I have a class with a date. If the user doesn't change it in the view, Rails saves today's date (the default values in the drop downs). I would like it to be saved as a null value instead. How do I do this? ...

Query to eliminate multiple rows based on oldest date

Working in MS Access 2003 SP3: I have a query that I am running to find what 'cars' were sold with a date after the delivery date. I have thousands of rows. When it is all said and done, I want to just have a handful of rows for each 'car' and then the oldest date. Any suggestions? CAR DATE ORDERED DATE DELIVERED CUSTOMER NU...

How to subtract years in R?

I have a date in R, e.g. dt = as.Date('2010/03/17'); I would like to subtract 2 years from this date, without worrying about leap years and such issues, getting as.Date('2010-03-17'). How would I do that? Thanks! ...

Is this a dangerous override for Date.today in Ruby (on Rails)? (Timezone)

class Date class <<self alias_method :broke_ass_today, :today end def self.today Time.zone.now.to_date rescue Date.broke_ass_today end end because I would really hate to replace Date.today with that statement everywhere in our code base... that and its just much simpler write (and read) date Date.today, because that's...