date

MYSQL retrieve results where date = next weekend

Currently I have two tables and the following sql statement which correctly retrieves the items in the events table ordered by their dates in the event_dates table: SELECT * FROM events, event_dates WHERE events.id=event_dates.event_id AND events.preview=0 AND event_dates.start_date>=now() ORDER BY event_dates.start_date ASC,eve...

Parsing Datetime

I have a date time as a string, eg. "2010-08-02", I'm trying to convert it to UTC with the following code snippet DateTime.ParseExact("2010-08-02Z", "yyyy-MM-ddZ", CultureInfo.InvariantCulture) When I print to the console, I get the following: 8/1/2010 5:00:00 PM. Is there a reason why the date shows up as the date before the date I'm...

Flex Date issue with Timezone

Hi All We have a search utility that needs to search by date: So I type in a date "04-20-1982" in the search field. In the code: Alert.show("string date::"+message.searchKeyword); dateOfBirth = DateField.stringToDate(message.searchKeyword,"MM-DD-YYYY"); Alert.show("date::"+dateOfBirth); The first alert prints as string date::04-20...

jquery datepicker sending date not as a string using .serialize()

When I am sending my date using .serialize() it is sending as an string not exact date format ...is there a way I can send it as 09/01/2010... not as a string ...

JDO not storing time information in Date, only stores the day

I am using Google App Engine with Java, JDO for persistence. I have my Activity object with timestamp declared as Persistent and of type java.util.Date. public class Activity ... { ... @Persistent private Date timestamp; ... } All Activities stored in the database are seen with correct dTate but time information is always zero. ...

how to get the number of days of the current month? in PHP

Hi, i want to check if today is the last day of the month, but i don't really know how. i want to write it in php. can you help? thanks, Sebastian ...

Can't get specific date from db -php

Hi, I'm trying to a date timestampted in my mysql db, but my code shows the current date instead. This is the code that I'm trying: $db_date = $row_news['nm_date']; $year = substr($db_date, 0, 4); $mon = substr($db_date, 4, 2); $day = substr($db_date, 6, 2); $orgdate = date("l dS F Y",mktime($mon, $day, $year)); $date = $orgdate The...

Python: Initialize a datetime object with seconds since epoch

Hi, The time module can be initialized using seconds since epoch: >>> import time >>> t1=time.gmtime(1284286794) >>> t1 time.struct_time(tm_year=2010, tm_mon=9, tm_mday=12, tm_hour=10, tm_min=19, tm_sec=54, tm_wday=6, tm_yday=255, tm_isdst=0) Is there an elegant way to initialize a datetime.datetime object in the sa...

Convert Date Format

User updated in Excel as 01-03-2010 (as in DD-MM-YYYY). How do I covert this into YYYYMMDD in SQL? I have tried using FromDate=Format(Sheet1.Range("A3"),"yyyymmdd") and when I executed the SQL statement, it doesn't show any result. ...

undefined method `to_sym' for nil:NilClass during a db:auto:migrate

I'm trying to run a db:auto:migrate in my system and it keep throwing the undefined method `to_sym' for nil:NilClass whenever it gets to a column that uses a type of date. If I change the field to a datetime and run the migrate, it will change the field to a date with no errors. What is causing this problem. I have to keep changing th...

MS-Access front-end does not recognise dates from SQL Server

I have a SQL Server 2008 database with an Access front-end. My problem is that Access does not recognise SQL Server's dates as they are in a different format. SQL Server-s format is YYYY-MM-DD Access' format is DD-MM-YYYY When the date is displayed in a text-box, it is displayed as a string (without the little calendar icon next to it)...

Custom formatting including dates

VB2005 In my app I present to the user an option to customize the name of the file that gets produced. The format string the program reads is something like "yyyyMMdd-%1-%2-%3-%4" which the user can customize to his liking. in this case the format of the date is yyyyMMdd and the %1 is the trip number like 1000P, %2 is the origin code l...

Absolute GMT date on iPhone

I'm trying to get a date that represents noon GMT for a recurring local notification. I need this local notification to fire at the exact moment to anyone using the app. So far, I'm trying this: NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *dateComps = [[NSDateComponents alloc] init]; [dateComps setHour:12]; [...

MySQL: week date range from week number in a query

Hello! I got a database table that looks something like this: | id | clock | info ---------------------------------------------- | 1 | 1262556754 | some info | 2 | 1262556230 | some other info | 3 | 1262556988 | and another | 4 | 1262555678 | and some more It contains lo...

How to convert String to Date without knowing the format?

Hi. I have a problem. I am trying to convert some strings to date, and I don't know the format the date is arriving. It might come as yyyy.mm.dd hh:mm:ss or MM.dd.yy hh:mm:ss and so on. How can I convert these strings to Date? I tried this: DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"); Date d = (Date)formatter.p...

Get the 2 digit year in T-SQL

I need to get the current 2 digit year and increment by one. So the current number I'm looking for should be 11. Probably really simple but I'm a sql noob :) Thanks ...

How to convert Joda LocalDate to String in Java?

I got the answer: It's very simple. DateTimeFormatter fmt = DateTimeFormat.forPattern("MM/dd/yyyy"); String formattedDate = jodeLocalDateObj.toString( fmt ); ...

Strftime of datetime

Hi, I got the below code which I would like to convert to a string in a specific format. But I can't get it working. Date.today + warning.notify_time_close.seconds What I want to do is somethin like this but it doesn't work :) (Date.today + warning.notify_time_close.seconds).strftime "%d-%m-%Y %H:%M:%S" I know its simple but just ...

How do libraries in different programming languages handle Date & Time, Timestamps & Durations, Leapseconds & -years, DSTs & Timezones, ...?

Is there a standard body or a specific normative way how time-related things should be implemented in practice (like ICU for Unicode-related tasks) or is this currently a "best-effort", depending on how much effort, time and money language and library implementers want to spend? Is there a specific and complete implementation which coul...

SSIS - How to easily parse yyyy-mm-dd hh:mm:ss a.m. format

I need to parse a date like "22/06/2010 3:21:31 p.m." in SSIS in a data flow. Cast(DT_DBTIMESTAMP ) does not work at this is does not handle this format. What is the easiest way that I can do this? ...