datetime

JExcelAPI - writing date to Excel sheet ignores day, month and year.

I try to generate some Excel sheets in Java application using JExcelAPI (v. 2.6.3) and can't generate date cells properly. For example, for code: WritableWorkbook workbook = null; workbook = Workbook.createWorkbook(new File("C:\\tmp\\tests.xls")); try { Date date = new Date(); final WritableSheet sheet = workbook.createSheet("Shee...

Flattening intersecting timespans

I have lots of data with start and stop times for a given ID and I need to flatten all intersecting and adjacent timespans into one combined timespan. The sample data posted below is all for the same ID so I didn't list it. To make things a bit clearer, take a look at the sample data for 03.06.2009: The following timespans are overlap...

Searching free accomodation

I need help with a query? I have 2 tables reservations & units among others. Table reservations has columns ResId,rfrom(datetime),rto(datetime),status(int),UnitID(foreign key). Status 2 means its confirmed. I need to get all free units in requested period, query needs to return only that units for which there aren't confirmed reservatio...

How do computers figure out date information?

Most languages have some sort of date function where you really don't have to do any programming to get any date information you just get it from the date function/object. I am curious what goes on behind the scenes to make this happen? ...

Issue with PHP getting an incorrect date from a C# web service

Ok this has been driving me nuts now for about 12 hours. I have a C# web service running under IIS 7 and I am connecting to it via PHP on a Apache 2.2 box. Not that any of that should really matter but figured I would drop it in. Now when I go directly to the web service and invoke it I get the correct datetime format but if I call it f...

How do I translate a ISO 8601 datetime string into a Python datetime object?

I'm getting a datetime string in a format like "2009-05-28T16:15:00" (this is ISO 8601, I believe) one hack-ish option seems to be to parse the string using time.strptime and passing the first 6 elements of the touple into the datetime constructor, like: datetime.datetime(*time.strptime("2007-03-04T21:08:12", "%Y-%m-%dT%H:%M:%S")[:6]) ...

mysql time and php time not the same

Hi - When I use current_timestamp with MySQL, I get the correct time, but when I use $mysqldate = date( 'Y-m-d H:i:s' ); I get the date with with an hour delay (eg, 4:42 PM is 5:42 PM). I understood that both function use the server's local time - can someone explain the difference? Thanks. ...

How can I get rows with start and end time between start and end time of another row in SQL?

I'm using aspect-oriented programming techniques to create very fine-grained logging for a class library. Each method call will be logged. I'm trying to develop a stacked bar chart with each call that comes from an instance of a class, with each sub-call occupying space in between the start and finish of the outer call to visually repr...

Java Timestamp - How can I create a Timestamp with the date 23/09/2007?

How can I create a Timestamp with the date 23/09/2007? ...

How do you determine which timezone is at 12am right now?

I am working on a cron job which sends report to hundreds of users around the world. The cron should send an email to all my users at exactly 12am in the morning according to their timezone. Thanks in advance ...

Where does ASP.NET get its culture settings from?

In an ASP.NET application I'm setting the culture to lv-LV. All is fine, but the default short date format seems to be "yyyy.mm.dd". The client wants it to be "dd.mm.yyyy" (which is actually the LV standard). Where does ASP.NET get the date/time settings for a specific culture? How can they be changed for a single culture, without affect...

MySQL: Retrieving count of records from a particular time frame

So what I'm trying to do is a bit tricky. I'm trying to come up with a sql query that will be able to return counts for specified time frames. So I have a table 'v'. Here is some basic data from Table v Table v _____________ id p_id created_at 1 1 2009-06-09 18:54:17 2 2 2009-06-09 21:51:24 3 2 200...

Check if date is this date or bigger

Hello. I trying to check if a date is this date or bigger inside my linq query with boolean. But it's not working like i want. This my code public bool CheckMonth(int month) { if (month > System.DateTime.Now.Month) { return true; } else if (month == System.Dat...

Showing Datetime using C#

I need to show timestamp as shown below in my .Net application: 13/12/2007 5:04 PM EST or 13/12/2007 5:04 PM CST depending upon the US timezone. How do i achieve this functionality using C#?? Thanks for reading. ...

End of month calculations

Hi guys Just wondering if any know of an elegant solution for the following. If I have 30 June 2009 and I add a month I want it to go to 31 July 2009, not the 30 July 2009. This logic is based on the fact that the 30 June 2009 was the end of the month of June and when I add a month I want to go to the end of the next month. But if...

Crystal Reports DateTime Formatting

Hello, I'd like to format a datetime in Crystal Reports to a include the day of week. From: 19/06/2009 To: Friday, June 19, 2009 Thanks, ...

How to represent a DateTime in Excel

What is the best way of representing a DateTime in Excel? We use Syncfusions Essential XlsIO to output values to an Excel document which works great. But I can't figure out how to display a DateTime in a column. Not when doing it myself directly in Excel either. Is it impossible? Do I have to use a separate date and a time column? I real...

Date format c#

Can I get DateTime.Now to be formatted to 2010-03-01T00:00:00Z I have used this to format the date part DateTime.Now.Subtract(new TimeSpan(3001, 0, 0, 0)).GetDateTimeFormats()[5] ...

Bind nullable DateTime to MaskedTextBox

I have a masked text box bound to a nullabe datetime, but when the date is blanked out, the validation on the masked text box won't complete. Is there a way to force this behaviour? I want a blanked out text box to equal a null DateTime. When the textbox is already null, the validation works. It only breaks when there is a date alrea...

Something like TryParse for dates/times in c++ (non-Windows)?

Does anyone know of a library that offers something similar to .NET's Parse/TryParse for dates and times that can be used on Linux from C++? I've looked at the Boost date/time code but I'm not sure that I can do it without specifying the particular input format before attempting to parse. Basically, I might have dates in any number o...