Sponsored Content
Top Forums Shell Programming and Scripting unixtime to formatted date time Post 302474147 by ctsgnb on Tuesday 23rd of November 2010 11:49:11 AM
Old 11-23-2010
Code:
date '+%Y%m%d,%H%M%S'

Code:
# date '+%Y%m%d,%H%M%S'
20101123,175038
# date '+%Y.%m.%d-%H:%M:%S'
2010.11.23-17:50:42
# a=`date '+%Y%m%d,%H%M%S'`                <------ or  a=$(date '+%Y%m%d,%H%M%S')
# echo $a
20101123,175117
#

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert DATE string to a formatted text

Hi guys, i need your help. I need to convert a date like this one 20071003071023 , to a formated date like 20071003 07:10:23 . Could this be possible ? Regards, Osramos (6 Replies)
Discussion started by: osramos
6 Replies

2. UNIX for Advanced & Expert Users

find formatted filename with date time

Hi, I operate and use HF radars along the California coast for ocean surface currents. The devices use Mac OS as the control and logging software. The software generates thousands of files a week and while I've used PERL in the past to solve the problems of finding files I come to realize some... (6 Replies)
Discussion started by: dpath2o
6 Replies

3. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

4. Homework & Coursework Questions

Date comparison with 'string date having slashes and time zone' in Bash only

1. The problem statement, all variables and given/known data: I have standard web server log file. It contains different columns (like IP address, request result code, request type etc) including a date column with the format . I have developed a log analysis command line utility that displays... (1 Reply)
Discussion started by: TariqYousaf
1 Replies

5. Shell Programming and Scripting

Get Formatted Date from Unix Epoch

Could someone please explain how to get a formatted date from the unix epoch (the number of seconds since Jan 1, 1970) For example., If the input is 1297969816, then the output should be 2011-02-17 in YYYY-MM-DD formatted manner. I am using AIX sh shell. Tried date -d and date --date, these... (4 Replies)
Discussion started by: Jesinth Nirmal
4 Replies

6. UNIX for Dummies Questions & Answers

Converting string date time to unix time in AWK

I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk. I tried This is how each line of the file looks like, different date and time in this format Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th ... (2 Replies)
Discussion started by: bkkid
2 Replies

7. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

8. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies

9. Shell Programming and Scripting

awk help reformatting badly formatted time field

I need help reformatting an input file with spaces in the time field (4th field). I want the field to look like “hh:mm” with appropriate embedded zeros, but instead it has “h :m “ if the hour and/or minute are single character. I'm pretty new to scripting and this is beyond me. Any help would... (4 Replies)
Discussion started by: lisep
4 Replies

10. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies
TRACESPLIT(1)							   User Commands						     TRACESPLIT(1)

NAME
tracesplit - split traces SYNOPSIS
tracesplit [ -f bpf | --filter=bpf] [ -c count | --count=count] [ -b bytes | --bytes=bytes] [ -i seconds | --seconds=seconds] [ -s unixtime | --starttime=unixtime] [ -e unixtime | --endtime=unixtime] [ -m maxfiles | --maxfiles=maxfiles] [ -S snaplen | --snaplen=snaplen] [ -z level | --compress-level=level] [ -Z method | --compress-type=method] inputuri [inputuri ...] outputuri DESCRIPTION
tracesplit splits the given input traces into multiple tracefiles -f bpf filter output only packets that match tcpdump style bpf filter -c count output count packets per output file. The output file will be named after the basename given in the outputuri with the packet num- ber of the first packet in this file. -b bytes output bytes bytes per file -i seconds start a new tracefile after "seconds" seconds -s unixtime don't output any packets before unixtime -e unixtime don't output any packets after unixtime -m maxfiles do not create more than "maxfiles" trace files -S snaplen Truncate packets to "snaplen" bytes long. The default is collect the entire packet. -z level Compress the data using the specified compression level, ranging from 0 to 9. Higher compression levels tend to result in better compression but require more processing power to compress. -Z compression-method Compress the data using the specified compression algorithm. Accepted methods are "gzip", "bzip2", "lzo" or "none". Default value is none unless a compression level is specified, in which case gzip will be used. EXAMPLES
create a 1MB erf trace of port 80 traffic. tracesplit -z 1 -Z gzip -f 'port 80' -b $[ 1024 * 1024 ] erf:/traces/bigtrace.gz erf:/traces/port80.gz LINKS
More details about tracesplit (and libtrace) can be found at http://www.wand.net.nz/trac/libtrace/wiki/UserDocumentation SEE ALSO
libtrace(3), tracemerge(1), tracefilter(1), traceconvert(1), tracesplit_dir(1), tracereport(1), tracertstats(1), tracestats(1), tracepkt- dump(1), traceanon(1), tracesummary(1), tracereplay(1), tracediff(1), traceends(1), tracetopends(1) AUTHORS
Perry Lorier <perry@cs.waikato.ac.nz> tracesplit (libtrace) January 2011 TRACESPLIT(1)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy