## Translate decimal into date

Translate decimal into date
# 1
08-05-2009
Translate decimal into date

Hello,
what can I do to convert a decimal number (001-366) into the day of the year it represent in the format of mm-dd-yyyy ?
I know about the date +%j, it gives me the number for the current date, what about a reverse of this, is there such a thing?
My number resides in a var, what can I do to obtain the date it represents?

Thanks!
 gio001 View Public Profile for gio001 Find all posts by gio001
# 2
08-05-2009
With the GNU version of the command date : Jean-Pierre.
 aigles View Public Profile for aigles Find all posts by aigles
# 3
08-05-2009
Thanks, but I am using ksh88.
I could use perderabo's datecalc, it works great (thanks to perderabo for all of it), I was just exploring the possibilities of getting the result via built in functionality.
Thanks again.
 gio001 View Public Profile for gio001 Find all posts by gio001
# 4
08-05-2009
Gio001, ksh88 is a very old version of the Korn Shell. If you upgrade to ksh93, it has excellent build-in date arithmetic support amongst other major enhancements.

To use Aigles example where the DOY is 217.
His output is in DD/MM/YY format. Mine, since I am in North America is in MM/DD/YY format.
 fpmurphy View Public Profile for fpmurphy Find all posts by fpmurphy

## Sum the fields with 6 decimal places - getting only 2 decimal places as output

I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2...

## Urgent help needed.. C++ program to convert decimal to hexa decimal

Hi , seq can be 0...128 int windex = seq / 8; int bindex = seq % 8; unsigned char bitvalue = '\x01' << (7-bindex) ; bpv.bitmapvalue = bitvalue; This is the part of a program to convert decimal to bitmap value of hexadecimal. I want this to change to convert only to...

## Convert hexa decimal to decimal

Hi, I want to convert two hexadecimal numbers to decimal using unix command line. 1cce446295197a9d6352f9f223a9b698 fc8f99ac06e88c4faf669cf366f60d I tried using `echo "ibase=16; \$no |bc` printf '%x\n' "1cce446295197a9d6352f9f223a9b698" but it doesn't work for such big number it...

## expr to translate the date command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. Write a script called "tod" that will display the time of day in am or pm notation rather then the 24 hour clock time. Use expr to convert from 24-hour clock time. Use...

## Help converting date-time value to decimal

Hi I need help to do some calculation in script. I have a monitor program (munin) that I would like to log uptime information from a server. The script looks like this (not complete): #!/bin/sh # server_uptime ### Config Start # Reads the server parameters using the HTTP port with...

## Decimal to BCD (Binary Coded Decimal)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary...

## Decimal to BCD (Binary Coded Decimal)

Anybody please help me... Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart. This is a unix qn... plz post algorithm for that :confused:

## how to sort date in decimal values uptp two digits

Hi all, there is a data in a file wich loks likes 00:00:49|24.48| 00:01:49|22.83| 00:02:49|22.07| 00:03:49|20.72| 00:04:49|21.28| 00:05:49|21.22| 00:06:49|21.38| 00:07:49|20.93| 00:08:49|21.27| 00:09:49|20.65| 00:10:49|19.42| 00:11:49|21.93| 00:12:49|20.62| 00:13:49|20.23|...

## Translate date value to normal date and backwards.

Hello, How do i translate datevalues in unix to normal dates. and how do i translate normal dates in to datevalues. I'm using the unix-date. Sample: 1067949360 to 4-11-03 12:36 and 4-11-03 12:36 to 1067949360 I want to built a script with a question to the user: give in date...