Hi folks,

Per Krzysztof's suggestion I've added the ability to pass ODBCDateTime strings that are missing leading zeros in the month, day, hours, minutes or seconds. In the case of seconds, if you intend "00" you can leave it off entirely (including the preceding colon). The year must still be a full four digit year and minutes cannot be left out. If you intend zero minutes you'll have to include (at least) ":0". Of course, to indicate midnight use "0:" or "00:" as the hours.

I think that I'll still add on to this plug-in the ability to work with ODBCDates (without the time) and ODBCTimes (without the date) Their format is {d 'yyyy-mm-dd'} or {t 'hh:mm:ss'} respectively. In the case of the ODBCDate I'll assume midnight on that date (00:00:00), and in the case of ODBCTime I'll assume the current date. I'll try to get those added later this afternoon or tonight.

Examples:

{ts '2006-4-1 2:5'}
{ts '2006-4-01 2:5'}
{ts '2006-04-01 02:5:0'}
{ts '2006-04-1 02:5:00'}
{ts '2006-4-10 2:55:00'}

Again, you can get the plug-in here.

Cheers,
Chris


Christopher Jordan wrote:
Krzysztof,

You're right. I am expecting the digits in the time format to have leading zeros, because I thought that was the "proper" ODBC format. But I should allow single digits, and prepend the zero. Good suggestion. I'll implement that in a few minutes.

Thanks,
Chris

Krzysztof FF wrote:
I've experienced many problems when converting date from database to usable
format, so your work is great.

But copying date taken after pressing "Current time", from:
Current Time in ODBCDateTime format: {ts '2006-11-9 14:57:5'}

and pasting it into Enter a string to convert box, gives an error:
"invalid odbc date format"

Correcting date string to {ts '2006-11-09 14:57:05'} (leading zeros in day
and seconds) gives proper answer:
Sat Dec 9 14:57:05 UTC+0100 2006

I do not know whether your output procedure is not up to format, or your
input procedure is too rigorous, but it shouldn't be that way...

Regards,

Krzysztof



  

_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to