date

Is it possible to format a date with sqlite3 ?

At start you have a string 'DDMMYYYY HHMMSS' and I want at the end to insert the string in a date field in sqlite3 database. The program is made in python. How can I do that ? ...

How to get a date field from MM/dd/yyyy to yyyy/MM/dd in vb.net.

Hi, I need to get a date field from MM/dd/yyyy to yyyy/MM/dd in vb.net but it should still be a date field afterward so that I can match it against a date in a database. At the moment all I'm managing to do is to change it to a string in that format. I tried this type of code which also did not work. DateTime.Parse(yourDataAsAStrin...

Hibernate: Delete where record field < getdate()

I'm having trouble figuring out how to delete a set of records when a particular field is less than the date on the sql server without using tables or field names. Since I'm using MSSQL the query would look something like this: DELETE FROM tickets WHERE expires < getdate() How would I go about getting Hibernate to do this? I'm lookin...

Java: getMinutes and getHours

How do you get Hours and Minutes since Date.getHours and Date.getMinutes got deprecated? Note: The examples that I found in google search used the deprecated methods. Thank you. ...

European date input in Django Admin

Django has a DATE_FORMAT and a DATE_TIME_FORMAT options that allow us to choose which format to use when viewing dates, but doesn't apparently let me change the input format for the date when editing or adding in the Django Admin. The default for the admin is: YYYY-MM-DD But would be awesome to use: DD-MM-YYYY Is this integrated in an...

Truncating Ruby Time objects efficiently

Hi, I am trying to come up with an efficient method for truncating Ruby Time objects according to a given resolution. class Time def truncate resolution t = to_a case resolution when :min t[0] = 0 when :hour t[0] = t[1] = 0 when :day t[0] = t[1] = 0 t[2] = 1 when :month t[0] ...

Get Previous Day

Possible Duplicate: How to determine the date one day prior to a given date in Java? If I have a Java.Util.Date object, what is the best way to get an object representing the 24 hours in the past of it? ...

How can I have the date from today show up with PHP?

I'm sending a mail function to myself. My first line reads 'Order for $name on $date' The $name variable comes from a form the user fills out. I would like the $date variable to be today's date, whatever that is on that day. How can I make the $date variable show today's date? ...

TFS : show modification (new and edited files) since a given date.

Hi; How can I ask TFS to show me only modified files (new and edited files) in a workspace (or in a folder) since a given date. Is it possible? or do I have to go myself through all the history and build my own "modification tree". Thank you for your help. ...

What's a good temporal distance to no longer display relative dates?

Relative dates are great to display the temporal incidence of recent activity, but at what distance is it an inconvenience for the user to see a relative date rather than an absolute one? Let's assume the context is a forum. ...

Is it possible to create a list of months between two dates in Rails

I am trying to create a page to display a list of links for each month, grouped into years. The months need to be between two dates, Today, and The date of the first entry. I am at a brick wall, I have no idea how to create this. Any help would be massively appriciated Regards Adam ...

django filter format for date

Hello, year_id (2004 etc) is a dropdown box on the template. The users selects a year and this is retrieved as year_id in the view. I need to select publications based on year from a field called grantstartdt which is in the format 2008-01-01. The error is: int() argument must be a string or a number, not 'Year' year_id = request....

Calculating a day given a Date

From a given Date I need to calculate midnight of its day. Here's what I came up with. It's so ugly that I figure there must be a better way. private Date day(Date creation) { Calendar calendar = Calendar.getInstance(); calendar.setTime(creation); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set...

Django - ORM question

Just wondering if it is possible to get a result that I can get using this SQL query with only Django ORM: SELECT * FROM (SELECT DATE_FORMAT(created, "%Y") as dte, sum(1) FROM some_table GROUP BY dte) as analytics; The result is: +------+--------+ | dte | sum(1) | +------+--------+ | 2006 | 20 | | 2007 | 2230 | | 2008 | 49...

WebFocus related query about date formats

I am not sure this is the right place to ask about Webfocus reporting tool, but... I want a date in WebFocus to display as day-Month-year (e.g. 4-Jun-2078). How can I do that? ...

Correctly storing dates with TimeZone in MySQL DB for a Rails application

I'm looking at converting our Rails 2.3 application to correctly handle time zones (at the moment everything is in UTC which isn't right, but is convenient!). I have these settings in environment.rb: config.active_record.default_timezone = :utc config.time_zone = "UTC" Going forward, on each request in our app I plan on making the fo...

Why are my dates not sorting correctly?

I wonder if anyone has come across this issue before. I have a string converted to a date and sorted ascending. The date is sorting numerically but it is not sorting on the month. I wonder if anyone has had this issue and can shed some insight as to how to get the date to sort correctly. SELECT u.url_id, url, title, descripti...

php/mysql: database of bank holidays and events like christmas, easter etc...

Hi guys, Im working on a simple calendar application and i want to have the above events display on the calendar [bank holidays and that]. The calendar is just a standard month view, with a link to view each day for each day in the month, and links to view next/ previous month and year etc... i will probably have the mktime for each e...

How do you convert a JavaScript date to UTC?

Suppose a user of your website enters a date range. 2009-1-1 to 2009-1-3 You need to send this date to a server for some processing, but the server expects all dates and times to be in UTC. Now suppose the user is in Alaska or Hawaii or Fiji. Since they are in a timezone quite different from UTC, the date range needs to be converted...

Representing Partial Dates in a JSON API

I am managing a RESTful JSON data API, which is growing in scope. Currently, we are returning all dates over the wire as strings "YYYY-MM-DD", but we also need to represent the concept of partial dates. What I mean by a partial date is a date value that has unknown components, either a Year-Month, or just a Year. In our presentation lay...