Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
How can I slit a data into variable

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
pierrot10
Smarty n00b


Joined: 08 Apr 2012
Posts: 4

PostPosted: Mon Apr 09, 2012 6:23 pm    Post subject: How can I slit a data into variable Reply with quote

Dear All,

I need to sepearate a viable into several

This is my varaible {$deal_end} (2012-04-12 18:21:40)

Because I am unsing a javascript fonction I need to slit it like this
{$year_end} //2012
{$mount_end} // 04
{$day_end} //10
{$hour_end} //18
{$min_end} //21
{$sec_end} //40

And then to use it in a javascript variable
<script>
dateTo = new Date({$year_end}, {$mount_end}-1, {$day_end},{$hour_end},{$min_end});

But my problem, I do not know how to slipt it into several varaible?

Someone can help me?
Cheers
</script
Back to top
View user's profile Send private message
pierrot10
Smarty n00b


Joined: 08 Apr 2012
Posts: 4

PostPosted: Mon Apr 09, 2012 6:42 pm    Post subject: Reply with quote

I found the alternative solution and it works fine

Code:
dateTo = new Date({$deal_end|date_format:"%Y,%m-1,%d,%H,%M,%S"});
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP