datetime

Date time picker inside JTable

Is it possible to add a DateTimePicker to a JTable Cell.A particular column should be updated with date and time..Is it possible to add such a component to a JTable ...

How to update timezonedb in PHP (updating timezones info)?

Hi, phpinfo() shows our system to be using ""Olson" Timezone Database Version 2010.3". I think that is now out of date, but can't locate an authoritative location which can confirm that. (a) Can I update the timezones info for PHP as a whole? (b) If so, how do I update this? I saw the instructions at http://www.electrictoolbox.com/co...

Problem with date formats in JavaScript with different browsers

Hi, I am working with dates in an RSS feed, but am finding differing results when using the code below in IE, Chrome and Firefox: new Date('2001-01-01T12:00:00Z') Firefox is happy with that, but Chrome and IE return Invalid Date. I thought I'd try replacing the T and Z as follows: new Date('2001-01-01 12:00:00') This time Chrome ...

Best way to manage date objects?

I have some date objects that are Date of the Date class, and others that are Time. The trouble is is that when I parse them to load them chronologically, they list first as the Times, followed by the Dates. This is the code that loads them : query.any_of do |any_of| any_of.with(:date).greater_than((params[:current_date] || Date...

PHP Date Recurrence Library?

Ruby, Java, and Python all have several very good libraries which allow you to handle rfc2445's rrule very well. I've done an extremely comprehensive search for a class/library which will handle the rrule and return dates of recurrence, however I haven't found 1 library in PHP will do it. I am going to begin to write a PHP library whic...

Representing Time (not date and time) in C#

Hi, I'm developing an app that requires the notion of opening times (A bit like a shop) How best to represent these? They will be persisted in a DB later... So far I have the following class: public class OpeningTime { public DayOfWeek DayOfWeek { get; set; } public DateTime OpeningTime { get; set; } public DateTime Closin...

How to compare date with milliseconds with LINQ

I try to make a query to my database with LINQ to SQL. example : var t = from a in context.A where a.date == myDate select a; The problem is the date from SQL was return with millisecond, myDate variable contain de good milliseconds, but when i compare the date together the comparaison is not valide because the default output of myDa...

manipulate a string in django to show past/future tense

I'm looking for a way to manipulate a string depending if it's in the past or the future, so I want to: Test to see if it's now or in the future add an "s" to the string Test to see if it's in the past add a "d" to the string I know this has come up before, but didn't find it in a search. Thanks! Wendy ...

How can I find records from today, yesterday and so on with Ruby on Rails?

Hi, I want to find all records, say Posts, created today with Ruby on Rails, then all Posts created yesterday, and so on… how should I do? Thank you, Kevin ...

Javascript - How can I work out the difference between two given times? (hours-minutes)

I have two sets of 'select' elements where the user can enter in two times. It looks like this: Start: [hour] [minute] [meridian] End: [hour] [minute] [meridian] I'm trying to take those times and figure out the difference. So I can then output: Difference: 1.25 HRS The decimal format, as you probably know, means 1 hour and 15 min...

best solution for Null DateTime value

I couldn't find best solution when DateTime value is NULL. I use this techinque When binding; _ACTIVATION_DATE = dt.Rows[0]["ACTIVATION_DATE"] == DBNull.Value ? new DateTime(1970, 12, 30) : (DateTime?)dt.Rows[0]["ACTIVATION_DATE"]; When Inserting; public void Insert() { string ad=""; string dd=""; if (ACTIVATION_DATE ==...

SQL Server 2005 error retrieving record based on Datetime primary key column

Hi All, I have a table in SQL Server 2005 with composite primary key, i.e. a foreign key (INT) and DateTime column. When i run the SQL, Select column1 From TABLE where ForeignKey=1 and DateTime='08/26/2010 11:24:36' No record was return when there is such a record. One option to do is Select column1 From TABLE where ForeignKey=1...

Best approach/data type(s) for a date and two times in .Net 4

Hi all, I've got a method which takes some parameters and generates some XML to be sent to an [archaic] web service. I need to include in the XML: Date (yyyy-mm-dd) Opening time (hh:mm) Closing time (hh:mm) Now in the past when I've had to provide a date/time separately, I've taken in a single DateTime parameter and for...

Best GMT time configuration by user | PHP

I was wondering how to do the best user configuration when the user sets his own GMT time, e.g. if a user was in the GMT+3 timezone and the user sets it via the UCP. What I've done was, every option in the drop-down menu: <select name="timezone"> ... <option value="-7200">GMT-2</option> <option value="-3600">GMT-1</option> ...

What isn't my TimeSpan.Add() working?

There has to be an easy answer: var totalTime = TimeSpan.Zero; foreach (var timesheet in timeSheets) { //assume "time" is a correct, positive TimeSpan var time = timesheet.EndTime - timesheet.StartTime; totalTime.Add(time); } There's only o...

Mysql Correctly compare 2 datetimes ?

Hello, I have an issue that i'm about to pull my hair out over, ok let me start. I'm using php and mysql i have a database that holds rows with information and one of the columns has a datetime field in a 24hr format. I am trying to retrieve information using the following query: SELECT * FROM `table` where `new` != '1' AND `time...

Add the current time to a DateTime?

Hello, I have a string which represents a date, its given back from a DropDownList. The string is "27.08.2010" for example. Now I want to add the current time to this and parse it to Datetime ... so in the end it should be a DateTime like 27.08.2010 15:12:45 for example. How could I do this? Right now, I am putting together a string usi...

Get date in php in 2 weeks

$addhr = time() + (1 * 13 * 60 * 60); $curDateTimeMil= date("Y-m-d G:i:s",$addhr); echo $curDateTimeMil; This will echo 2010-08-27 16:21:31. How can I get the date after 2 weeks? (sept 10) ...

checking month name against unix timestamp stored in mysql db (using php)

Having trouble working out how to do the following - I want to list all the events for a given month, with each event having a date stored as a unix timestamp in the database. In my sql query, I have to manipulate the timestamp so that i can check if the date is in the same month as the month string i'm comparing against, e.g "october". ...

JSON Date parameter passed to MVC Action is always null

I have a range of parameters that are passed via jQuery Ajax to an MVC JsonResult action. For the most part, these arrive successfully, but there is a Date value that is not arriving at all. What considerations / formats do I need to use - or what approaches do I need to take - in order to get this date to arrive successfully? ...othe...