strftime

Vim script: how to retrieve the timezone offset?

I would like to get the timezone offset of the user environment in a Vim script and that must be portable (Unix/linux/MacOSX, Windows). For example, if the user is in Paris, its timezone offset is currently +2 (UTC+2). Portability concerns exclude using external programs or non native scripting engines (Perl, Python, Ruby...). ...

Converting unix timestamp string to readable date in Python

I have a string representing a unix timestamp (i.e. "1284101485") in Python, and I'd like to convert it to a readable date. time.strftime returns me with a type error. Any help is appreciated! ...

Using strftime function in mawk

I'm trying to create AWK script that will filter the input file according to some pattern, and use the strftime() function for some calculations. ($2 ~ /^[HB]/ && $2 ~ /n$/){ print strftime("%Y") } The interpreter in use is mawk. When triggering this script using this command: awk -f script3 inputFile I'm getting the error...

Strftime of datetime

Hi, I got the below code which I would like to convert to a string in a specific format. But I can't get it working. Date.today + warning.notify_time_close.seconds What I want to do is somethin like this but it doesn't work :) (Date.today + warning.notify_time_close.seconds).strftime "%d-%m-%Y %H:%M:%S" I know its simple but just ...

SQL query to obtain a count of how many items have each possible value for a given column

Okay, so I have a (SQLite) table called log wherein one column (time) is a Unix epoch timestamp (the other columns are irrelevant for my purposes). These are timestamped log entries. I am trying to get a count of how many items are logged per hour (all-time -- I don't care to do it only for a given day or whatever; I'm trying to get an ...

Ruby strftime: Month without leading zero?

Does Ruby's strftime have a format for the month without a leading zero? I found %e for getting the day without the leading zero, but not having any luck with the month. Ultimately wanting a date formatted like: 9/1/2010 ...