Sponsored Content
Top Forums Programming converting unix timestamp into readable format using c++ Post 302181875 by shamrock on Friday 4th of April 2008 10:56:22 AM
Old 04-04-2008
Question Decoding date and time

If you know how the date and time has been encoded in the 32-bit hexadecimal string '45d732f6' then it's possible to come up with something that makes sense Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Converting BMP to BM (or other unix format)

Hey pllz, ive got a little problem, i want to convert a bmp of gif or jpg to an unix format (bm) anybody got any suggestions ? greets\EJ (1 Reply)
Discussion started by: EJ =)
1 Replies

2. UNIX for Advanced & Expert Users

Select entries between two dates by converting Unix timestamp in Oracle Database.

Hi, I need to select the entries between two dates from an Oracle db. The Oracle db has a column with Unix timestamps. I use the following querry, but it doesnt seem to be working as desired. select count(*) from reporter_status where to_char(FIRSTOCCURRENCE, 'mm-dd-yy') between ('08-07-06')... (1 Reply)
Discussion started by: amitsayshii
1 Replies

3. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies

4. Shell Programming and Scripting

convert unix date to readable format

Dear Experts, I need your help to convert a unix date and time format number in to readable format like dd/mm/yyyy . I have a text file of more than 10,000 records and it is like NAME DATE1 COUNTRY DATE2 ABD 1223580395699 USA 1223580395699... (3 Replies)
Discussion started by: shary
3 Replies

5. UNIX for Dummies Questions & Answers

Unix timestamp to readable date

How would I convert a unix timestamp such as "1232144092" to a readable date such as "1/16/2009 10:14:28 PM" ? I thought I could use date, but I don't think so now.. Any help would be great!! (4 Replies)
Discussion started by: Rhije
4 Replies

6. UNIX for Dummies Questions & Answers

Converting binary file to readable format in Ksh

In Unix/Ksh, when I try to look inside a file it says that the file may be a binary file and if I want to see it anyway. When i say 'yes', it shows me the content filled with unreadable symbols (looks like binary). Is there a command that I can run from the Unix prompt to convert/translate that... (3 Replies)
Discussion started by: arthurs
3 Replies

7. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

8. UNIX for Dummies Questions & Answers

converting scripts from dos 2 unix format

Hi, I am new to shell scripting and exploring it , I have developed few sample shell script but I have developed them on windows xp notepad and then saving them on folder and then testing them on cywgin and running perfectly...but these scripts are in dos format and I want to convert them in unix... (1 Reply)
Discussion started by: rahul125
1 Replies

9. Shell Programming and Scripting

Converting a random epoch time into a readable format

I am trying to create a script that will take epoch (input from command line) and convert it into a readable format in bash/shell ---------- Post updated at 08:03 PM ---------- Previous update was at 07:59 PM ---------- #!bin/bash read -p "Please enter a number to represent epoch time:"... (9 Replies)
Discussion started by: sprocket
9 Replies

10. Shell Programming and Scripting

Convert UNIX timestamp to readable format in the file

Hello I have a file : file1.txt with the below contents : 237176 test1 test2 1442149024 237138 test3 test4 1442121300 237171 test5 test7 1442112823 237145 test9 test10 1442109600 In the above file fourth field represents the timestamp in Unix format. I found a command which converts... (6 Replies)
Discussion started by: rahul2662
6 Replies
SG_DECODE_SENSE(8)						     SG3_UTILS							SG_DECODE_SENSE(8)

NAME
sg_decode_sense - decode SCSI sense data SYNOPSIS
sg_decode_sense [--binary=FN] [--file=FN] [--help] [--hex] [--nospace] [--status=SS] [--verbose] [--version] [--write=WFN] [H1 H2 H3 ...] DESCRIPTION
This utility takes SCSI sense data in binary or as a sequence of ASCII hexadecimal bytes and decodes it. The primary reference for the decoding is SPC-3 ANSI INCITS 408-2005 and the most recent draft SPC-4 revision 29 which can be found at http://www.t10.org and other loca- tions on the internet. SCSI sense data is often found in kernel log files as a result of something going wrong but may just be informative. It is often shown as a sequence of hexadecimal bytes, starting with 70, 71, 72, 73, f0 or f1. Sense data could be up to 252 bytes long but typically is much shorter than that, 18 bytes long is often seen and is usually associated with the older "fixed" format sense data. The sense data can be provided on the command line or in a file. If given on the command line the sense data should be a sequence of hexa- decimal bytes separated by space. Alternatively a file can be given with the contents in binary or ASCII hexadecimal bytes. The latter form can contain several lines each with none, one or more ASCII hexadecimal bytes separated by space (comma or tab). The hash symbol may appear and it and the rest of the line is ignored making it useful for comments. OPTIONS
Arguments to long options are mandatory for short options as well. -b, --binary=FN the sense data is read in binary from a file called FN. -h, --help output the usage message then exit. -H, --hex this option is used in conjunction with --write=WFN in order to change the output written to WFN to lines of ASCII hex bytes suit- able for a C language compiler. Each line contains up to 16 bytes (e.g. a line starting with "0x3b,0x07,0x00,0xff"). -f, --file=FN the sense data is read in ASCII hexadecimal from a file called FN. The sense data should appear as a sequence of bytes separated by space, comma, tab or newline. Everything from and including a hash symbol to the end of that line is ignored. If --nospace is set then no separator is required between the ASCII hexadecimal digits in FN with bytes decoded from pairs of ASCII hexadecimal digits. -n, --nospace expect ASCII hexadecimal to be a string of hexadecimal digits with no spaces between them. Bytes are decoded by taking two hexadeci- mal digits at a time, so an even number of digits is expected. The string of hexadecimal digits may be on the command line (replac- ing "H1 H2 H3") or spread across multiple lines the FN given to --file=. -s, --status=SS where SS is a SCSI status byte value, given in hexadecimal. The SCSI status byte is related to but distinct from sense data. -v, --verbose increase the degree of verbosity (debug messages). -V, --version output version string then exit. -w, --write=WFN writes the sense data out to a file called WFN. If necessary WFN is created. If WFN exists then it is truncated prior to writing the sense data to it. If the --hex option is also given then ASCII hex is written to WFN (see the --hex option description); otherwise binary is written to WFN. This option is a convenience and may be helpful in converting the ASCII hexadecimal representation of sense data (or anything else) into the equivalent binary or a compilable ASCII hex form. NOTES
Unlike most utilities in this package, this utility does not access a SCSI device (logical unit). This utility accesses a library associ- ated with this package. Amongst other things the library decodes SCSI sense data. EXAMPLES
Sense data is often printed out in kernel logs and sometimes on the command line when verbose or debug flags are given. It will be at least 8 bytes long, often 18 bytes long but may be longer. A sense data string might look like this: f0 00 03 00 00 12 34 0a 00 00 00 00 11 00 00 00 00 00 Cut and paste it after the sg_decode_sense command: sg_decode_sense f0 00 03 00 00 12 34 0a 00 00 00 00 11 00 00 00 00 00 and for this sense data the output should look like this: Fixed format, current; Sense key: Medium Error Additional sense: Unrecovered read error Info fld=0x1234 [4660] For a medium error the Info field is the logical block address (LBA) of the lowest numbered block that the associated SCSI command was not able to read (verify or write). EXIT STATUS
The exit status of sg_decode_sense is 0 when it is successful. Otherwise see the sg3_utils(8) man page. AUTHORS
Written by Douglas Gilbert. REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2010-2011 Douglas Gilbert This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
sg_requests(sg3_utils) sg3_utils-1.32 March 2011 SG_DECODE_SENSE(8)
All times are GMT -4. The time now is 05:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy