I am using OpenERP version 6.1 and OpenERP web client. The OpenERP server is installed in my laptop hence both server and the client on the same machine.
The issue I am facing is that it looks like OpenERP treats my local time as current UTC time.
My time zone in Windows is set to UTC+5:30 hours (Asia/Colombo) and the current time is 11:00 AM. When I see the current time from OpenERP using,
'date_created': lambda *a: datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
It shows me 03/29/2012 16:30:24 instead of correct time 11:00 AM. My observation is that OpenERP get the current time and add 5 hours 30 minutes to current time and shows me. So, OpenERP assumes my current local time as the current UTC time.
I must install the software at clients site but without this fixed, I cannot install.
The OpenERP v6.1 Release Notes state that now the server and database work exclusively with UTC dates, ignoring the OS timezone settings.
The timezone conversion is made dynamically by the client:
the Web client uses the browser setting (which usually matches the client machine settings)
the GTK client uses the setting in the user preferences.
There is one golden rule for datetime fields in 6.1 addons code:
"ALWAYS work in UTC - compute in UTC - save in UTC"
The UTC values will be properly converted to local time when the result is
diplayed in a client-side form.
Related
I am working on a development Plone 4.3.3 site with Zope 2.13.22 on Debian and noticed when I ran my backup using collective.recipe.backup that the backup time in the file name is 6 hours ahead of my system.
Example:
Backup name = 2014-08-06-17-08-15.fsz
System time (and write time according to properties) = 2014-08-06 11:08:15
I have checked multiple areas of Plone and they all match my system time.
My buildout.cfg contains the correct Time Zone information.
Any ideas as to what might be causing this or how to correct it? Thank you in advance.
IIRC, this is how the backup script works. Time values are always rendered in UTC, not server local time. This allows for unambiguous ordering of backup files.
If you look at the source of the repozo script used for backup you can see that the date portion of the filename always uses time.gmtime() so this is not something you can change.
I am trying to create the installer for my product.It must be work for 30 days after installation.After 30 days it must expire and make the application not to work.Please tell me how can i do this in wix ?
I would implement this in the main application executable. More flexible and reliable. You can also do it in a custom action that tags a part of the registry in a fashion to indicate install and expiration date.
Personally I think it is safer to have the application contact a server, get today's date and then set up the application to stop working in 30 days, and if you can't contact a server default to the system's time and date, and verify that it was correct when network connection is available.
I'm having a hard time of searching about retrieving/getting server time without using GET DATE(). My previous application, I used GET DATE() and it works but when it is installed in local pc(multiple users) the get date is not the same just like the other PC. Then I search about netapi32.dll from other forum sites (Here!) it does work in local pc and other pc not running OS SERVER but in getting server time with OS SERVER installed its no luck.
BTW, this is a WinForm Application.
Any ideas or alternatives is much appreciated.
Thank you in Advance.
If you need a consistant time without using a server, the only think I can suggest is using an Internet Time Server. I would not sugest you query the server everytime you need the time but just query it once, at startup, and track the offset from the local computers' time.
Here is some information on getting the Internet time if you like: Sync Internet Time with Computer
I have WebSphere 8 running on AIX and am currently experimenting with date simulation. For this purpose I use a software package called Time Machine from SolutionSoft.
The idea with Time Machine is that it replaces the system time API so that a user can specify any date, a frozen date and even the cadence.
Now, this is all very well and AIX and for instance date and "touch -m" both work as expected. When it comes to WAS8 there is quite a different story.
From what I can tell keeps WAS picking up the real time and not the system time, and this is a bother as you can realise. I have not found a way to make WAS aware of the simulated time - I have tried restarting the WAS-processes to no avail.
Anybody know how the combination WAS/AIX is handling time and, more specifically, how I can persuade WAS to pick up the simulated time?
The answer is to first make Time Machine aware of the JRE that comes with WAS as this is not done automatically. This is done with the tminstall command:
tminstall -j <path to JVM directory>
Once done, it is possible to manipulate the WAS time using the tmuser command. For example
tmuser -a -u wasuser -x 122323592015
to set the time to almost midnight, the night before Christmas 2015.
In our rails app, the timezone is set to UTC in our environment file. This doesn't cause any problems when running on our production or staging servers. However, none of our local development machines are set to UTC in the system clock, and this is causing some test failures when comparing dates. This is because Rails is using UTC when we call DateTime.now, where-as our MySQL database is using the system time (CST in my case).
Is there a way to ensure that in certain cases, DateTime.now does NOT use the UTC timezone? I guess what I'm asking for is a pure SQL way of updating date fields, which bypasses the Rails engine.
Actually you should be able to tell rails to use local settings only for development and other environments like test by adding this to corresponding config/environments file :
config.time_zone = "Eastern Time (US & Canada)" #Change this
config.active_record.time_zone_aware_attributes = false
config.active_record.default_timezone = :local
That worked for me, but I switched everything including production to local time. But I don;t see why this approach wouldn't work per environment!