date

RAILS: paperclip and creation date based directory structure

Hi there, does anyone know how I can configure my rails model, which is using paperclip for data storage, to use creation date based directories like for example in fleximage ?? At present I'm using: has_attached_file :bookblock, :path => "#{CONF['storage_path']}bookblock/:id_partition/:style.:content_type_ehas_attached_filextension" ...

What is this date format called and how do I parse it?

I have a weird date format in some files I'm parsing. Here are some examples: 1954203 2012320 2010270 The first four digits are the year and the next three digits are day of year. For example, the first date is the 203rd day of 1954, or 7/22/1954. My questions are: What's this date format called? Is there a pre-canned way to parse ...

Intercepting Date objects coming from BlazeDS and adjusting for timezone differences

I am working on an application that is near the end of its development cycle and has mostly passed user testing. We recently realized that having flex convert dates to the client's local timezone is not desired, as all of our dates are in EST and contain no time data. Since BlazeDS sends dates in UTC, this results in the dates being conv...

Using date of type char in where clause

I have a SQL Server database table with a char column named "DATE" (I know, really bad, but I didn't create the database) that has dates stored in this format as strings: YYMMDD. I need to return records between these dates, so treat them as actual dates and I've tried every combination I know but still get errors. Any help is much appre...

How calculate the day of the week of a date in ruby?

How calculate the day of the week of a date in ruby? For example, October 28 of 2010 is = Thursday ...

How can I use PHP to list all the dates in a year?

Hi, I'm trying to use PHP to create a script that searches all the days between now and one year's time and lists all the dates for Fridays and Saturdays. I was trying to use PHP's date() and mktime() functions but can't think of a way of doing this. Is it possible? Thanks, Ben ...

Date not showing on consecutive posts on Wordpress

Hi everyone, I have a news section that shows posts only with a category of "news". The code is shown below. The problem is, only the first news post gets a date above it. All the posts following the most recent "news post" don't have dates. Anyone have any idea why this is happening? Thanks! Amit <div id="news"> <?php ...

How do I convert a datetime to a UTC timestamp in python

from http://docs.python.org/library/time.html time.mktime(t): This is the inverse function of localtime(). Its argument is the struct_time or full 9-tuple (since the dst flag is needed; use -1 as the dst flag if it is unknown) which expresses the time in local time, not UTC. It returns a floating point number, for c...

Date sensitive regression testing using python

Hey, I am helping to set up a regression testing suite for our python web application. Many of our tests are scheduling style tests where the current date is important. For example: create a recurring event that runs every week for a month starting on Feb 1. In order to test this, what I really want to do is override the current date so...

averaging event values associated with date values by hour, day, etc..

I have a bunch of events with values (how many people went through a doorway). Each event is associated with a Date. There is no fixed period to the events .If no one comes through the door, no event is generated, but often multiple people can go through at once, so the value can be greater than one. Sometimes events are minutes apart f...

Convert string to date in jQuery and Internet Explorer?

I want to convert a date string to a date object in jQuery, and the code below works fine for Chrome and Firefox, but not in Internet Explorer: <script type="text/javascript" charset="utf-8"> //Validate if the followup date is now or passed: jQuery.noConflict(); var now = new Date(); jQuery(".FollowUpDate").each(function () ...

How to change MySQL date format for database?

We are using a MySQL database with FileMaker. It appears that when FileMaker is reading the MySQL tables, it will only accept dates in the format of m/d/y. Is there any way I can get our MySQL database to change its default format to be m/d/y instead of YYYY-MM-DD? I know I can use the DATE_FORMAT() function on individual SELECT queri...

JavaScript validate existance of date

Hello! I have a date in the format YYMMDD. Is there anyway I can validate it in JavaScript? By validation I don't mean easier things like length, characters etc but rather if the date exists in real life. I'm hoping there is a faster / better way than breaking it in 3 chunks of 2 characters and checking each individually. Thank you. ...

Date as double digit

Hi All I've a code to get year, month and day for one of my application. package com.cera.hyperionUtils; import java.util.*; public class HypDate { public static int curdate(int field) { //1. Specify integer 1 for YEAR, 2 for MONTH, 5 DAY_OF_MONTH Calendar c = new GregorianCalendar(); c.setLenient(true); //Allow overflow ...

python getting weekday from an input date.

Hi I'm trying to work on a homework problem where I have an input date in the format YYYY-MM-DD I need to import a couple modules and create a function weekday where it splits up the date and returns the weekday. So far I imported: from time import * from datetime import * I need help in my weekday function where I must use a .spl...

Not Sure It's a bug on Chrome Browser.

Hi guys~~~~~ I got about javascript console to display date problem using Chrome v7.0517.41 browser(not sure if it is a bug) and OS is WinXP SP3. In javascript console, i type console.log(new Date()); then display : Sat Oct 30 2010 22:49:57 GMT+0800 (China Standard Time) //it's now on local time I change system time to +1 month ...

Get a page's last modified date using Java

Is there a standard way to tell when a page was last modified? Currently I am doing this: URLConnection uCon = url.openConnection(); uCon.setConnectTimeout(5000); // 5 seconds String lastMod = uCon.getHeaderField("Last-Modified"); System.out.println("last mod: "+lastMod); However it looks like some sites do not have a Last-Modifie...

SELECT to get two entries, from same table, differentiated by date, in one row

I have a table in which i keep different meters (water meter, electricity meter) and in another table i keep the readings for each meter. The table structure is like this : The meter table MeterID | MeterType | MeterName The readings Table: ReadingID | MeterID | Index | DateOfReading The readings for a meter are read monthly. The t...

How can I get today's date where the user currently is?

Does Date.today() return the current date based on the server's date? If so, how can I get the correct date for a user? ...

Is this a date in Feburary or in March? cal.set(2010, 1, 10)

I have set this calendar in my app: Calendar cal = Calendar.getInstance(); cal.set(2010, 1, 10); I'm using this SimpleDateFormat to get the month as a word: SimpleDateFormat formatMonth = new SimpleDateFormat("MM"); In one class it comes out as February 10th, 2010. In another it comes out as March 10th, 2010. Which is correct? ...