Re: [Templates] mysql date parsing

[prev] [thread] [next] [Date index for 2004/07/01]

From: Dennis Daupert
Subject: Re: [Templates] mysql date parsing
Date: 20:00 on 01 Jul 2004

>it DOES store the timestamp in unix seconds. What it doesn't do
>it emit the raw unix time... and the UNIX_TIMESTAMP wrapped
>around it quite simply dumps the raw integer value of the timestamp.

Ahhhhh! Mark, I see a discussion of UNIX_TIMESTAMP in the mysqsl manual:

"If UNIX_TIMESTAMP() is called with a date argument, it returns
the value of the argument as seconds" " date may be a DATE string,
a DATETIME string, a TIMESTAMP...."

Gosh, I think I'm about to learn something here. (I hope!)

Here's my query:

SELECT apps.emp_fname,apps.emp_mname,apps.emp_lname,apps.emp_email,
       apps.emp_phone,apps.company,apps.status,apps.city,apps.state,
       roles.rolesym,apps.suppcompanies,apps.timestamp
       FROM apps,roles
       WHERE apps.role = roles.roleid AND apps.active = '1'
       ORDER BY apps.emp_lname

Timestamp is described thus:

TIMESTAMP(14)

When I print the value of [% app.timestamp %] I see timestamp values
in format YYYYMMDDHHMMSS.

>The way to fix the output of SQL is with SQL.

I'm with you; I'd much rather keep it simple, use what's at hand.
I need to learn how.

Sooooo close. Now I'm trying to figure out how to feed the value in
apps.timestamp to UNIX_TIMESTAMP()

This does not work:

SELECT apps.emp_fname,apps.emp_mname,apps.emp_lname,apps.emp_email,
       apps.emp_phone,apps.company,apps.status,apps.city,apps.state,
       roles.rolesym,apps.suppcompanies,UNIX_TIMESTAMP(apps.timestamp)
       FROM apps,roles
       WHERE apps.role = roles.roleid AND apps.active = '1'
       ORDER BY apps.emp_lname

Can you help me through?

Moocho apprecianatto,

/dennis


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

Re: [Templates] mysql date parsing
Dennis Daupert 13:52 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Mills 15:42 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 16:48 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Mills 17:56 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 18:38 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Mills 18:54 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 20:00 on 01 Jul 2004

Re: [Templates] mysql date parsing
Dennis Daupert 20:17 on 01 Jul 2004

Re: [Templates] mysql date parsing
Mark Fowler 10:06 on 15 Jul 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52