Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:53:59+00:00 2026-06-14T01:53:59+00:00

I am using date and time to label a new file that I’m creating,

  • 0

I am using date and time to label a new file that I’m creating, but when I view the file, the colon is a forward slash. I am developing on a Mac using 10.7+

Here is the code I’m using:

 File.open("#{time.hour} : 00, #{time.month}-#{time.day}-#{time.year}", "a") do |mFile|
        mFile.syswrite("#{pKey} - #{tKey}: \n") 
        mFile.syswrite("Items closed: #{itemsClosed} | Total items: #{totalItems} | Percent closed: % #{pClosed} \n") 
        mFile.syswrite("\n")
        mFile.close
     end

Here is the output (assuming the time is 1pm):

13 / 00, 11-8-2012

Why is this happening and how can I fix it? I want the output to be:

13:00, 11-8-2012
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:54:00+00:00Added an answer on June 14, 2026 at 1:54 am

    Once upon a time, before Mac OS X, : was the directory separator instead of /. Apparently OS X 10.7 is still trying to fix up programs like that. I don’t know how you can fix this, if you really need the : to be there. I’d omit it :-).

    EDIT: After a bit more searching this USENIX paper describes what is going on. The rule they use apparently is this:

    Another obvious problem is the different path separators between HFS+ (colon, ‘:’) and UFS
    (slash, ‘/’). This also means that HFS+ file names may contain the slash character and not
    colons, while the opposite is true for UFS file names. This was easy to address, though it
    involves transforming strings back and forth. The HFS+ implementation in the kernel’s VFS
    layer converts colon to slash and vice versa when reading from and writing to the on-disk
    format. So on disk the separator is a colon, but at the VFS layer (and therefore anything
    above it and the kernel, such as libc) it’s a slash. However, the traditional Mac OS
    toolkits expect colons, so above the BSD layer, the core Carbon toolkit does yet another
    translation. The result is that Carbon applications see colons, and everyone else sees
    slashes. This can create a user-visible schizophrenia in the rare cases of file names
    containing colon characters, which appear to Carbon applications as slash characters, but
    to BSD programs and Cocoa applications as colons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using date/time, time, but it doesn't help. Exception Details: System.Web.HttpException: DataBinding: 'DatePickerControl.DatePicker'
i have one problem when i sort the NSMutablearray using date and time wise.
This should hopefully be a simple one. When using a date time picker in
I'm currently passing some date-time info to a web page using url parameters, which
I'm using java.text.SimpleDateFormat to parse string representations of date/time values inside an XML document.
Is there any reason behind using date(January 1st, 1970) as default standard for time
How do I convert string(09-Apr-2010) in to date time (09 April 2010 00:00:00) using
I am using two button s Date and Time .They are working well .
I am using DateField to display the Date and Time in my Blackberry Program,if
For some reason using Content={Binding Time, StringFormat=t} is still giving me a long date.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.