English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

thanks in advance
i am a S/W Engineer(Trainee)
i got a problem in my project regarding assigning file names for dynamically creating files,
for this file name format i have to use current date,time(mmddyy,hhmmss).(If i use the same format then i am getting 12 digits, i need to reduce this to 10 digit only)
by using this date and time the system should generate a unique 10 digit file name .
i changed the time into (hhmmss-6digits) in to a 5 digit seconds format (converting in to only seconds) .
is there any way to change the date (6digits) in to another numbersystems are some thing like that ...
any ideas are mostly welcome

2007-03-22 18:45:43 · 4 answers · asked by Anonymous in Computers & Internet Software

4 answers

If you're allowed to use letters as well as numbers, you can take the current time, as a 32-bit unix timestamp value, which has a range from 1970 to 2039 with resolution of 1 second, and display it in hexadecimal (like printf "%08x") which would give you 8 characters.

Or you could cut off 2 digits from your current format by replacing mmdd with day-of-year, which needs 3 digits, and the time with the number of seconds since midnight, which only needs 5 (there are 86400 seonds in a day).

2007-03-22 19:21:53 · answer #1 · answered by undercoloteal 3 · 0 0

I think, if it is only a time thing that decides the file name, and must be less than 10 digits in length. You could try using the seconds of the year only.
60 * 60 * 24 * 30 * 12 = 31, 104, 000 seconds in one year.
If you were to convert this to base 32 your 8 digits is represented using only 5 digits,

(10 numbers ( 0 - 9) plus 26 letters ( A - Z) = 36 characters You only require 32 characters.).
By using a base 32 you should get a lot of years our of it before expanding or adopting a new system, is my thought.

2007-03-25 08:19:23 · answer #2 · answered by Anonymous · 0 0

I am giving you a method to reduce 'number of digits' needed for time indication.

You need "year, month and date" identification.

1) You may use end two digits of each year say 00 for year 2000, 07 for year 2007, 08 for year 2008,... 99 for year 2099.

2) You may combine month and date of 'a- start 3 month'(JAN, FEB, MAR - 31+28+31) as 01...90

3) Similarly next 3 months as 01...91

4) Next 3 months as 01...92

5) Next 3 months as 01...92

6) This method uses 4-digits for time indication in a very effective manner. (It gives an opportunity to each user of a 10-digits number to relate it with 'an articles source-time'. a 2-digits for year-indication means, the system will help each user to concurrently relate articles of a-hundred year,( which is greater than a human life-cycle)!

7) Incidently, number system disclosed above will separately identify 10^6 differrent identification needs of a day, which I hope is good enough to you!

However you need to use each number like , JAN, FEB, ...DEC and then 10 digits number as shown hereinafter.

10-digits numbers will be used like "JAN 0731000001"
or "FEB 0759222223" or MAR 0791333334 ... so on! Your number system shall autamatically relate year and month as a 4 digits number which is a skill needed to a system designer! Don't accept comments of others as a cause to disregard the system explained here!

Effectively you are still left with 'six digits of 10 numbers' to imagine a system you have to run.

Always use time indicator digits (year, month, date- 0731, 0759, 0791 etc) as start-digits as shown, which will help you to carry on with 'a10 digits number system' forever!

You may feel a bit uncomfortable to use it initially, but it will soon disappear!

I appreciate your decision to use a smaller ten-digits number irrespective if computer capability to use more-digits-numbers! Effectively people has to relate articles to numbers and so smaller numbers are a need! A computer capability is an irrelevant factor!

Regards.

2007-03-22 22:24:26 · answer #3 · answered by kkr 3 · 0 0

0323071111

you dont need mss

2007-03-22 18:52:14 · answer #4 · answered by ? 4 · 0 0

fedest.com, questions and answers