Results 1 to 5 of 5

Thread: filename w/date & time in ubuntu/windows

  1. #1
    Join Date
    Nov 2007
    Beans
    4

    filename w/date & time in ubuntu/windows

    in ubuntu i want to have filenames with the date and time added to them. i know i can do this by doing filename-$(date +%F-%T).mpg

    the result looks nice in ubuntu
    TV_Recording-2008-09-08-18:04:47.mpg

    but not so nice in windows...
    THMZAH~O.MPG

    this is probably because windows doesn't understand -$(date +%F-%T). how do i adjust the filename so it'll also work in windows?

  2. #2
    Join Date
    Mar 2008
    Location
    City of Pines
    Beans
    3,585

    Re: filename w/date & time in ubuntu/windows

    Duh, why not try asking that question on windoze forum. As you could see, you're logged onto Ubuntuforums.org w/c tackles more on Ubuntu/*Linux questions.
    Steady movement is more important than speed, much of the time. So long as there is a regular progression of Stimuli to get your mental hooks into, there is room for lateral movement. Once this begins, its rate is a matter of discretion.

  3. #3
    Join Date
    Feb 2007
    Beans
    23,454
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: filename w/date & time in ubuntu/windows

    Quote Originally Posted by magicmt View Post
    in ubuntu i want to have filenames with the date and time added to them. i know i can do this by doing filename-$(date +%F-%T).mpg

    the result looks nice in ubuntu
    TV_Recording-2008-09-08-18:04:47.mpg

    but not so nice in windows...
    THMZAH~O.MPG

    this is probably because windows doesn't understand -$(date +%F-%T). how do i adjust the filename so it'll also work in windows?
    Hi and welcome,
    Moved to windows discussion.

  4. #4
    Join Date
    Nov 2007
    Location
    Atlanta, Georgia
    Beans
    494
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: filename w/date & time in ubuntu/windows

    Quote Originally Posted by magicmt View Post
    in ubuntu i want to have filenames with the date and time added to them. i know i can do this by doing filename-$(date +%F-%T).mpg

    the result looks nice in ubuntu
    TV_Recording-2008-09-08-18:04:47.mpg

    but not so nice in windows...
    THMZAH~O.MPG

    this is probably because windows doesn't understand -$(date +%F-%T). how do i adjust the filename so it'll also work in windows?
    I have done something like this with windows server 2003. The problem I came across is the date/time format in windows is stored in the registry (wouldn't be windows if it wasn't), contains a delimiter that is not valid in a filename (my file was just cut off after the first instance of the delimiter), and I could not find a way to modify the format anywhere other than the registry. I don't recall the final solution I worked out but it changed the date/time format for the whole server so I imagine its in hklm. I just searched around on google for a while and found where the format lives.
    GNU/Linux>Windows

  5. #5
    Join Date
    Nov 2007
    Beans
    4

    Re: filename w/date & time in ubuntu/windows

    i got it. windows doens't like colons in the filename. so the solution is to just use another date function for the time that doesn't have colons, like:

    TV_Recording_$(date +%m.%d.%Y_%I.%M%P).mpg

    looks uglier, but it works

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •