date

Get year from boost ptime

Hi, This is my first post on stackoverflow. First of all I'd like to say thanks for this site! It has provided many excellent answers to questions I've had in the past few months. I'm still learning C++, coming from vb6. I'm converting an existing program to C++ and here need to manipulate Sybase timestamps. These timestamps contain dat...

How should I store a date in PHP for use with javascript?

What I want to do is make a script on the server read a text file, sort it, then output it to a javascript object (probably via JSON). The text file in question looks something like this: 13/09/2009,17/09/2009,Arbitrary dates 14/09/2009,18/09/2009,Some random comment 14/09/2010,18/12/2010,A comment to the dates 14/09/2010,18/09/2010,A ...

Invoke a date picker instead of a standard keyboard

Hi all, I need to invoke a UIDatePicker when i tap on a textfield. usually when we tap on a textfield the keyboard pop ups. but i need a date picker instead of that. can anyone help me please...! Thank you in advance. ...

Last sunday of a year in c#

Hi guys, How can I get date of last sunday of a year in C#?? Will gregoriancalendar class be of help? ...

PHP, alternating weeks logic

I need to write some code in PHP that performs an action only on alternating weeks, based on the day of the week (mon, tue etc) rather than the number (1st, 7th etc). So on a cycle starting on a Monday it should run for one week then not the following week. I am sure this must be easier than I think but can't seem to work it out, so h...

How do I change constraints in a dojo DateTextBox dynamically?

I tried to do this: dojo.mixin(endDate.constraints, {min: new Date(2009,09,14)}); But as a result I got this: min Wed Oct 14 2009 00:00:00 GMT+0200 (CET) ??? It always adds one month! Is this a bug? But what I actually want to do is something like this: dojo.mixin(endDate.constraints, {min: dijit.byId("beginDate").date}); Th...

Working with time in the iPhone

I have two arrays with time values in them in this format. 00:00:00 which is minutes:seconds:miliseconds. Can someone show me any easy way of adding an subtracting these values? I know I can if I break them down but I am looking for a way to do it without of code. I can get the last values which is what I want to work with like this ...

PHP - date() reduction bug?

I am using a unix time stamp as the base of my starting date for use in a date ranged query. The start date is not the problem, for the purpose of this example i will use the following time stamp: 1228089600 (01 December 2008 00:00:00). For use in my query I needed to easily figure out the last day of any given month to the last second ...

Can a JSON object returned by PHP contain a date object

Is there a way to create a JSON object in PHP that contains a javascript date object? Does json_encode automatically convert PHP's DateTime to Javascript's date? ...

Is there a preexisting Javascript function to read "2009-09-16T11:10:00" as a date?

Possible Duplicate: How can I convert datetime microformat to local time in javascript? Im writing up an ajax application where i have to interpret this date "2009-09-16T11:10:00" and output another string to something more readable. ...

extending DateInterval, unknown property error

I'm using PHP's new(ish) Date classes for a calendar/scheduler I'm developing. I am trying to extend DateInterval so that I limit the interval to particular sizes like 1 year, 1 month, 1 week or 1 day. The extended class would be used to help generate the calendar view. I'm getting the PHP error: Unknown property (days) when I run the f...

Weird difference between new Date() and FileCreation date.

I'm running some test to prove a concept and i just wrote this code and found a weird situation: public class Test { public static void main(String[] args) { Date now = new Date(); File file = new File("/root/batch-experiments/test.txt"); try { file.createNewFile(); } catch (IOException e) { System.o...

Maven + system Date

Hi all! I'm working in a project that already have a build process running with maven. Today the build generates a zip file in a given directory, but I need to add the DATE pattern in the file, something like 200917_projectName.zip Someone have any clue? Thanks in advance ...

php and mysql. WHERE date <= X Hours ago?

I was wondering what is the best way to write the where statement in PHP where targetDate < Date.Now - HardCodedHours in PHP ...

How can I get the real time in iPhone, not the time set by user in Settings?

Hi, I need to ensure that my app gets the correct time, not the time set by the user in settings. So for instance, once the user starts the app, I'd want to get a timestamp. The user would see the elapsed time on a timer on screen updated every second. When the user exits the app, and after some time restarts the app , the timer wou...

Round Date to nearest 15 minute interval in Flex

I am building a control to allow me to set a meeting time, and I would like it to use as a default, the current time rounded up to the nearest 15 minute interval. So if it is currently 6:07, it would read 6:15 as the start time. Does anyone know how this might be accomplished, or have run across a code snippit that would put me on the r...

Drupal 6: How do I only call up "events" by upcoming date?

I am a newbie to Drupal so this may be a simple answer... I am building a site that on the homepage I want to be able to call up events that will happen in the next 6 months and then disappear after the event has past. I have made a field called event_start_date that you can enter the "From" and "To" dates. I already used Views to call ...

xslt .net and date diffs

Using .net XsltCompiled transforms, whats the best way to perform date diffs? Is defining a C# code snippet via the ms:script CDATA block "good enough"? or is moving to a different transform engine worth it i.e. Saxon? ...

Get Daylight Saving Transition Dates For Time Zones in Java

I'd like to know the simplest way, in Java, to get a list of dates in the future where daylight savings time will change. One rather inellegant way to do this would be to simply iterate over a bunch of years' worth of days, testing them against TimeZone.inDaylightTime(). This will work, and I'm not worried about efficiency since this wi...

Zero-based month numbering

Some popular programming languages use month numbering which is off by 1 -- JavaScript comes to mind, as does Java, and if memory serves, C is another. I have some questions: If you are going to be ignoring the month numbering used by laypeople, then why not for the sake of consistency also ignore the day numbering used by laypeople, a...