Weather: another method? Format time?

Discussion and questions about anything in the tech section, or any of the software or libraries I've released or have worked on.
paulg
Posts: 6
Joined: Tue Jun 03, 2003 12:11 am
Location: Surrey UK

Weather: another method? Format time?

Postby paulg » Tue Jun 03, 2003 11:55 pm

Giz,

I noticed that you use the time so:

Code: Select all

// Datetime of the weather information.  All dates appear to be EDT. 
var $wdate;


Do you think we could optionally reformat the time to, say, GMT so that we could call a local time?

If not I might try to get round to extending the class, but it seems best to try and call it from inside the class.

Could it work something like this?

$ivw = new IVWeather($uvw,'UK');

If not I could try and make a JS function to reformat it on the client?

Whaddyathink?

Giz
Site Admin
Posts: 57
Joined: Wed May 07, 2003 6:19 pm

Re: Weather: another method? Format time?

Postby Giz » Wed Jun 04, 2003 11:36 am

paulg wrote:Giz,

I noticed that you use the time so:

Code: Select all

// Datetime of the weather information.  All dates appear to be EDT. 
var $wdate;


Do you think we could optionally reformat the time to, say, GMT so that we could call a local time?

If not I might try to get round to extending the class, but it seems best to try and call it from inside the class.

Could it work something like this?

$ivw = new IVWeather($uvw,'UK');

If not I could try and make a JS function to reformat it on the client?

Whaddyathink?


You really read my mind. I did intend to convert the date/time to GMT, although I'm not sure whether it's worth going to the extreme of adding a whole lot of conversion code, considering that there are probably numerous classes available that can already handle that type of chore.

At any rate, if you do make any extensions in the class, please post them here, so I can consider including them in a future release.

paulg
Posts: 6
Joined: Tue Jun 03, 2003 12:11 am
Location: Surrey UK

Postby paulg » Wed Jun 04, 2003 11:53 am

yes i suppose so.

But what if I live in France? (which I do) then its GMT +1, this made me think..

instead of say, an array of countries how about doing EDT -5

so the call to the class instead of:

$ivw = new IVWeather($uvw,'UK');

could be

$ivw = new IVWeather($uvw,-5);

might be a bit of type-juggling to handle -5, and then again some users will want to format the text differently I guess.. still would be more of a globally useful class.

As you say, then bringing in a 'nicedate.class' could be easier.

I am not sure how I can help on this, not a great writer of classes m'self.

Paul


Return to “Tech”

Who is online

Users browsing this forum: No registered users and 1 guest