Sponsored Content
Full Discussion: file date format
Top Forums UNIX for Advanced & Expert Users file date format Post 302072161 by ludenso on Friday 28th of April 2006 07:07:26 AM
Old 04-28-2006
Java

-rw-rw-r-- 1 xos xos 0 Apr 28 12:54 test.txt

There are 2 problems with the date information returned by the ls -l command :
1) the month is not indicated numerically 01 .. 12
2) the year is only displayed if it is older than 6 months

These two factors complicate reformating the output of the line above into 20060428
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies

2. Shell Programming and Scripting

Format a date in a csv file

So I have a csv file where the 3rd field is a date string in the format yyyy-mm-dd. I need to change it to mm/dd/yyyy. So each line in the csv file looks like: StringData,StringData,2009-02-17,12.345,StringData StringData,StringData,2009-02-16,65.789,StringData Any idea how I can keep... (5 Replies)
Discussion started by: rpiller
5 Replies

3. Shell Programming and Scripting

convert date format to mysql date format in log file

I have a comma delimited log file which has the date as MM/DD/YY in the 2nd column, and HH:MM:SS in the 3rd column. I need to change the date format to YYYY-MM-DD and merge it with the the time HH:MM:SS. How will I got about this? Sample input 02/27/09,23:52:31 02/27/09,23:52:52... (3 Replies)
Discussion started by: hazno
3 Replies

4. UNIX for Dummies Questions & Answers

Changing from Excel date format to MySQL date format

I have a list of dates in the following format: mm/dd/yyyy and want to change these to the MySQL standard format: yyyy-mm-dd. The dates in the original file may or may not be zero padded, so April is sometimes "04" and other times simply "4". This is what I use to change the format: sed -i '' -e... (2 Replies)
Discussion started by: figaro
2 Replies

5. Shell Programming and Scripting

How to change date format in file

Hello! I have a textfile that look like this: "83d1:46:2b";"20091008190000";"Rögle BK - Skellefteå";"Swedish" "d4c:46:21";"20091008190000";"Södertälje - Brynäs";"Swedish" "d4b:46:2";"20091008190000";"HV 71 - Färjestad";"Swedish" "838:46:b";"20091010160000";"Skellefteå - HV 71";"Swedish"... (2 Replies)
Discussion started by: condmaster
2 Replies

6. Shell Programming and Scripting

finding date numeral from file and check the validity of date format

hi there I have file names in different format as below triss_20111117_fxcb.csv triss_fxcb_20111117.csv xpnl_hypo_reu_miplvdone_11172011.csv xpnl_hypo_reu_miplvdone_11-17-2011.csv xpnl_hypo_reu_miplvdone_20111117.csv xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Discussion started by: manas_ranjan
10 Replies

7. Shell Programming and Scripting

File date format how to change

Hi All, Below are the unix files taken by the help of ls -lrt -rw-r--r-- 1 kbehera Domain Users 293 Jul 27 13:33 sand.txt -rw-r--r-- 1 kbehera Domain Users 4 Jul 27 13:37 sand1.txt -rw-r--r-- 1 kbehera Domain Users 293 Jul 27 15:30 new_sand.txt -rw-r--r-- 1 kbehera Domain Users 0 Jul 27... (2 Replies)
Discussion started by: krupasindhu18
2 Replies

8. UNIX for Dummies Questions & Answers

Rename all Files in a UNIX Directory from one date format to another date format

Hi Unix Gurus, I would like to rename several files in a Unix Directory . The filenames can have more than 1 underscore ( _ ) and the last underscore is always followed by a date in the format mmddyyyy. The Extension of the files can be .txt or .pdf or .xls etc and is case insensitive ie... (1 Reply)
Discussion started by: pchegoor
1 Replies

9. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" keep giving me this error : date: invalid date ‘19-01-2017 00:05:01' Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies

10. UNIX for Beginners Questions & Answers

Change date format in a file.

Hi all, I have a file as below, i would like the change the format of the time from "11/7/2019 20:12" to "2019-07-11 20:12:00" in the last coloumn. any awk solution on this. Input: 2,0,695016,1961612,497212,5800804,0,0,161,33,7605,12226,23,10,66,0,0,34,11/7/2019 20:10... (4 Replies)
Discussion started by: Raghuram717
4 Replies
TCAL(1) 						      General Commands Manual							   TCAL(1)

NAME
Tcal - runs the Gcal program with the date of tomorrow's day. SYNOPSIS
tcal [--help | --version] | [--shift=[+|-]number] [Argument...] DESCRIPTION
Tcal is a program which runs gcal with a date set one day ahead (equivalent the --shift=1 option). All given arguments are passed unmodi- fied to the Gcal program. If the Gcal program shall be called with another date than tomorrow's date, this desired date can be selected by using the --shift=[+|-]number option, in which [+|-]number is the distance of days the desired date is distant from the actual date (works only for Gregorian years). The --shift option must be given before all other arguments which are passed to the Gcal program. An exit status of 0 means all processing is successfully done, any other value means an error has occured. OPTIONS
--help Print a usage message listing all available options, then exit successfully. --version Print the version number, then exit successfully. --shift=[+|-]number Define the displacement in [+|-]number days the desired date is distant from the actual date. ENVIRONMENT
GCALPROG The GCALPROG environment variable contains the file name of the executable Gcal program, which is used by Tcal to call Gcal. This takes precedence over the file name `gcal', which is burned-in during the compilation step of tcal. COPYRIGHT
Tcal Copyright (c) 1995, 96, 1997, 2000 Thomas Esken This software doesn't claim completeness, correctness or usability. On principle I will not be liable for any damages or losses (implicit or explicit), which result from using or handling my software. If you use this software, you agree without any exception to this agree- ment, which binds you LEGALLY !! Tcal is free software and distributed under the terms of the `GNU General Public License'; published by the `Free Software Foundation'; version 2 or (at your option) any later version. Any suggestions, improvements, extensions, bug reports, donations, proposals for contract work, and so forth are welcome! If you like this tool, I'd appreciate a postcard from you! Enjoy it =8^) AUTHOR
------------------------oOO \\_''/ OOo--------------------------- Thomas Esken O (/o-o) O eMail: esken@gmx.net Im Hagenfeld 84 (( ^ )) Phone: +49 251 232585 D-48147 Muenster; Germany \____) ~ (____/ MotD : 2old2live, 2young2die SEE ALSO
gcal(1), txt2gcal(1), gcal2txt(1). June 14, 2000 TCAL(1)
All times are GMT -4. The time now is 03:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy