Joomla Calendar Field Type - joomla

I have implemented a module which has a Calendar Type as following:
<field
name="file2calendarEnd"
type="calendar"
default="5-10-2008"
label="End date"
description="Select when the slide will be published"
format="%d %B %Y" />
The problem is, when I open the module from the backend, pick a date, for example "23-10-2016" and save it, the next time I open the module , the date will display "22-10-2016". No matter what date I pick, the module will substract a day when I open it.
The date saves correctly on the databse, because if I pick "23-10-2016" on the module, saves it, and then print it on the frontend, the website will display "23-10-2016" , but if I open the module on the backend, the date will display "22-10-2016".
What can be causing the module to substract a day each time I open the module? Thank you

I Test your code on localmachine and it works well.
But got the same issue when i change User Time zone from Default to New York
you can change user timezone in Users > Manage > your user > Basic Settings
You can also check at Global Configuration > Server Settings.
Hope it helps

Related

EWS Java SendInvitationsMode SendToNone

i dont understand a sence of SendInvitationsMode.SendToNone.
Msdn.microsoft.com shows, how appointment could be created with this
option:
https://msdn.microsoft.com/en-us/library/office/dd633661(v=exchg.80).aspx
But when i am not using this option and set only start- and end-date to the same date (for example 2016-12-12) and save like this:
appointment.save();
, i expect, that outlook shows me in my calender this appointment only on the date: 2016-12-12.
But outlook shows me some different days. Obviously start- and end-date will be ignored, when i'am not set this option, when i save appointment: SendInvitationsMode.SendToNone.
"SendToNone" means for me, that this appointment will not be send to something else.
SendToNone means if you have a Meeting that when you create the meeting appointment meeting invitations will not be sent when you call save.
But when i am not using this option and set only start- and end-date to the same date (for example 2016-12-12) and save like this:
What are you trying to achieve though? are you trying to create an All Day appointment ? https://msdn.microsoft.com/en-us/library/office/dn756538(v=exchg.150).aspx the thing to be careful of here is matching the timezone if you have users in different timezone.

How to display Timestamps as per User's location in cshtml

Hi I am using Razor as template for my .net applications.
Currently I am displaying time by #DateTime.Now.ToString("f").
Please help me how can I display date time specific to end user's zone in razor
use this keyword
local time depends on where the computer is located. The universal time is independent of this
#DateTime.UtcNow;
TimeZone zone = TimeZone.CurrentTimeZone;
// Demonstrate ToLocalTime and ToUniversalTime.
DateTime local = zone.ToLocalTime(DateTime.Now);
DateTime universal = zone.ToUniversalTime(DateTime.Now);

How to change the title text on the Magento sales email?

How can I change the title text on the sale email?
I always get this in my email when I make an order,
Main Website Store: New Order # 100000016
I want to change it to,
[Name of my Store]: New Order # 100000016
Is it possible? where can I change it?
Also, in the sale email content,
Thank you for your order from Main Website Store. Once your package
ships we will send an email with a link to track your order. If you
have any questions about your order please contact us at
support#example.com or call us at Monday - Friday, 8am - 5pm PST.
Your order confirmation is below. Thank you again for your business.
Where can I change all this? Especially Main Website Store?
Go to System -> Configuration
Under the General Tab click General and select Shop Information. Enter the name of your store here.
The new order template files is located in
app/locale/en_US/template/email/sales/order_new.html
and
app/locale/en_US/template/email/sales/order_new_guest.html
You can edit these files directly, but it's better to create an overwrite in the Magento Backend:
System -> Transactional Emails -> Add New Template
and then choose New Order / New Order for Guest, click load template and edit the mail template. Template Subject will look like:
{{var store.getFrontendName()}}: New Order # {{var order.increment_id}}
Change this to:
[Name of my store]: New Order # {{var order.increment_id}}
I would recommend an email override extension such as https://www.yireo.com/software/magento-extensions/email-override. This allows you to override email templates in code rather than having to do it through the database. Makes it much easier to manage, transport to other stores, and is independent of core updates.

Server time in Joomla

Do you know of any way to check the current time in Joomla considering the selected time zone in global configuration?
I have been looking in administrator settings but did not see any single word about the current time.
You can use the following code:
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
This does two things. The first line creates a DateTimeobject based on the current server time and timezone. The following two lines get Joomla's global configuration and change the timezone of out date object to that timezone.
You can then format the date to whatever format you like by calling $date->format('Y-m-d H:i:s');. You can replace the format specifier by whatever you need, a reference of possible formatting options can be found here: http://www.php.net/manual/de/function.date.php

Managing Timezone in magento

How to manage timezone in magento at the time of product creation, in frontend i am filtering products by time,but problem is that client wants to show products creation time depend on user's timezone ? for example i am adding a product in admin area it shows 12.21pm but at the same time customer viewing this product from other country it should displays current time according to user's time zone, how can we do that?
please help me to get out of this.
Thanks in advance.
Be more specific about how you are generating the date and how you wish it to be displayed...
Here is a general approach:
In your template code place a span with a class around your time values. These time strings can be formatted with lots of options including the timezone in your php code.
Place javascript where appropriate: either in the header (onload function), in the footer or inline with your view.phtml.
In your javascript use the Prototype library to iterate over the time spans, e.g.:
$$('yourdateclass').each(function() {
//
});
On each of those elements convert the time with Date.parse() to a date object. Then use getTimezoneOffset to account for the visitors location, add/subtract accordingly and then update the element inner html to your preferred way of showing the time/date.
It worked for me.
$session = Mage::getSingleton('customer/session');
$time_zone = $session->getCustomer()->getTimezone();
$timeoffset = Mage::getModel('core/date')->calculateOffset($time_zone);
$timeoffset = $timeoffset - Mage::getModel('core/date')->getGmtOffset($time_zone);

Resources