I faced an issue for setting the default time zon in my Joomla shopping cart site.
I am using Joomla 1.7 and VM2.0.6 .
I can set the default time zone from the Joomla administrator but in the VM this time zone is not getting/saving in DB.
I have to set the time zone correctly for orders and registration the VM using a function for getting the time zone.
vmJsApi::date("Y-m-d h:i:s ",'LC2',true);
Did anybody have some idea about this function it will return the result in 24h format i want that in 12hr and correct the time .
Any link to reference or hint will appreciated.
Thanks in advance..
Related
In phpinfo, default.timezone & default.datetime as America/New_york.
In joomla configuration file offset as "America/Newyork". Offset user as "UTC". In backend user setting as "Newyork."
Actually the problem as When i create a article, the time save as as UTC format in database, But when we view the created date in the article, it shows 5 hours ahead to the created time. Whenever i save the article it increase 5 hours from the current date.
Please advice.. Thank you.
Add this line as the first line in your code,
date_default_timezone_set('Asia/Kolkata');
Change the timezone ('Asia/Kolkata') to your timezone.
You can check your timezone name Here.
If it is specific about Joomla, then
using JHtml::('date' , ....) for output
https://compojoom.com/blog/entry/how-to-use-jdate
Also, When you call JFactory::getDate() it will construct a JDate object, which already takes the timezone into account.
More info:
http://docs.joomla.org/How_to_use_JDate
http://api.joomla.org/cms-3/classes/JDate.html
http://api.joomla.org/cms-3/classes/JFactory.html#method_getDate
Finally, I found the issue in the server timezone. I have changed the server timezone to GMT/UTC. it was working fine. Thanks for all your contribution
In forum whenever anybody messages or posts something, the time is displayed wrong, it is showing half an hour back time. The default timezone is set as "UTC" and for India timezone is "UTC+05:30". I tried to change it to "UTC+05:30" and "Asia/Kolkata" but it didn't work. I think this function date_default_timezone_set() will not accept "UTC+05:30" but "Asia/Kolkata" is also not working for me.
Calendar app take value date(January 1st, 1970) as default in frontend if device language is english[Hongkong SAR china] in my website based on magento framework.Is there any solution to get current time? and the problem is only in Internet Explorer.
here is the screenshot
Finally the problem is solved. And the code is here, ( It works in all browser because of its constant English[US] time format and it doesn't care about your browser's language.)
before,
$currentDate = new Zend_Date(Mage::getModel('core/date')->timestamp());
after,
$currentDate = new Zend_Date(Mage::getModel('core/date')->timestamp(),null, "en_US");
I'm building a blog engine in CakePHP and I would like to show the current visitor articles relative to their local time of day.
For visitors where it's currently morning, then I'll show articles related to starting your day and news items that happened overnight.
For visitors where it's currently evening, then I'll show articles that recap the highlights of major events during the day.
The only possible solution I can think of is to send their current timezone via Javascript to the server, but this can only happen after the web page has loaded. How can I did this at the time the CakePHP application renders the pagination view for index action?
Not exactly sure about php, However this will work in all language.
You better store difference in GMT for user using
i copied syntax from internet
var d = new Date()
var n = d.getTimezoneOffset();
now at very first page, run this code on page load and store value of n in DB using ajax or whatever.SO whenever your user login you get the time diff till he/she logout.Use that DB value (store in session for better use) to further process.
Further create function like
addGMTDiff()
{
// fetch stored value for difference and return
}
call this function after every sql query that fetched UTC time.
I am working on rss parser project, I need to fetch URL from us based server and store the data in to database while storing/viewing I need to keep the post time.
I am using simplepie for rss aggregation, I face the following problem while handling rss
while I am checking rss url in firefox 3.0.19/system timezone set to Chennai/Kolkatta/Mumbai(UTC+5:30)now firefox displays post time for the post is 10:51 am
at the same time if i check the same url in another system which has firefox 3.6.1/system timezone set to Chennai/Kolkatta/Mumbai(UTC+5:30) now firefox displays post time for the post is 11:34 am
how do I know which time is correct?
and how do I get timezone for the RSS Server for php
RSS Feeds stored in one server and I installed PHP application in another server both of them located in us.
Which timezone should I use?
i set following time zone in my code
<?php
date_default_timezone_set('US/Central');
?>
but post time is wrong when display
i solved the problem my self using below method
get list of all timezones take first post's post date and set the first timezone format the date and set the second timezone format the date and so on.. finally i compared formatted date with postdate then i got the timezone of the server