Wine is a software to allow running Windows applications in Linux, MAC etc. platforms. It is available for installation from package managers like yum (RHEL, CentOS) and apt (Ubuntu). You can find more details on how it works in Wine wiki . But the default Wine package available from package manager does not have support for 32 bit Windows applications. This was the case for me. In Redhat Enterprise Linux 7.3, the wine package did not contain support for 32 bit windows applications. So the only option was to build a separate rpm of wine which will include this support. All the steps are executed on a RHEL 7.3 VM (x86_64). Step 1 Download and run shell script which will make wine 64 and 32 support for RHEL: https://github.com/zma/usefulscripts/blob/master/script/install-wine-i686-centos7.sh It accepts a version no. as CLI parameter e.g. 2.0.3 The script installs wine in /usr/local/ directory by default. We can verify the files that are being copied for wine using "
Converting current time to UTC (GMT) in python is a very common query that is searched in Google but, I did not find a compact answer when I did the search for my work. I figured out the code by some help from Google and some experimentation of my own. I'll share the code, in case it is useful to someone.
First I'll explain the Epoch time (or POSIX/Unix time) and UTC (Coordinated Universal Time) time format.
Epoch time is calculated as number of seconds elapsed since midnight Jan 1, 1970. It is used in all *nix systems and has become a standard when considering date/time from multiple systems. In python time module allows us to get the current epoch time in local time zone.
UTC time is basically synonymous of GMT. It marks the 0 offset time zone. Time in all other time zones are calculated with positive/negative offset from UTC. It is used in many cases where there are multiple machines, located in different time zones are involved. To get current UTC time in python we use utcnow() function from datetime module. But, if you need the time in seconds you need to do the following -
You can match the correctness of generated time in http://www.epochconverter.com/ by converting Human date to timestamp in GMT format.
First I'll explain the Epoch time (or POSIX/Unix time) and UTC (Coordinated Universal Time) time format.
Epoch time is calculated as number of seconds elapsed since midnight Jan 1, 1970. It is used in all *nix systems and has become a standard when considering date/time from multiple systems. In python time module allows us to get the current epoch time in local time zone.
UTC time is basically synonymous of GMT. It marks the 0 offset time zone. Time in all other time zones are calculated with positive/negative offset from UTC. It is used in many cases where there are multiple machines, located in different time zones are involved. To get current UTC time in python we use utcnow() function from datetime module. But, if you need the time in seconds you need to do the following -
You can match the correctness of generated time in http://www.epochconverter.com/ by converting Human date to timestamp in GMT format.
Are you saying that the value you are getting for epoch_time_in_local_timezone is different from current_utc_time_in_sec? Everything I've read says that time.time() is seconds from the epoch, which in almost every machine is from 1970-01-01, 00:00 UTC (see http://stackoverflow.com/a/11845878/2016290). Also, it looks like the source code for datetime.datetime.utcnow() and time.time() both end up using _PyTime_gettimeofday() to get the current time (see Modules/_datetimemodule.c and Modules/timemodule.c in http://hg.python.org/cpython).
ReplyDeletePrecisely that is what I observed that time. It was Ubuntu 10.04/python 2.6 as far as I remember.
DeleteBoth methods return same timestamp values.
ReplyDelete