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

  • Home
  • SEARCH
  • 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 8936015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:07:11+00:00 2026-06-15T10:07:11+00:00

I am getting some weird output with my Ruby code. Here is the code:

  • 0

I am getting some weird output with my Ruby code. Here is the code:

            mDate = schedule['date']
            sTime = schedule['startTime']
            eTime = schedule['endTime']

            puts "Original Start Time: #{sTime}"
            puts "Original End Time: #{eTime}"
            puts "Original Date: #{mDate}"

            sDate = mDate
            eDate = mDate

            puts "sDate: #{sDate}"
            puts "eDate: #{eDate}"

            @startTime = sDate.concat("T" + sTime + "Z")
            @endTime = eDate.concat("T#{eTime}Z")
            @date = schedule['date']

            puts "Start Time: #{@startTime}"
            puts "End Time: #{@endTime}"
            puts "Date: #{@date}"

            puts "Original Start Time: #{sTime}"
            puts "Original End Time: #{eTime}"
            puts "Original Date: #{mDate}"

Here is the output:

Original Start Time: 15:00:00
Original End Time: 15:00:00
Original Date: 2012-12-05
sDate: 2012-12-05
eDate: 2012-12-05
Start Time: 2012-12-05T15:00:00ZT15:00:00Z
End Time: 2012-12-05T15:00:00ZT15:00:00Z
Date: 2012-12-05T15:00:00ZT15:00:00Z
Original Start Time: 15:00:00
Original End Time: 15:00:00
Original Date: 2012-12-05T15:00:00ZT15:00:00Z

Can anyone shed some light as to why 1. values are changing 2. why concat is adding the value twice 3. wtf I’m doing wrong here?

  • 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-15T10:07:12+00:00Added an answer on June 15, 2026 at 10:07 am
    sDate = mDate.clone
    eDate = mDate.clone
    

    otherwise they all end up being the same object.

    Also, please explain something about the problem, instead of just dumping code and output. By the end of your question, I read “wtf I’m doing wrong here” as “wtf I’m doing here”.

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

Sidebar

Related Questions

I'm getting some weird output when running (seemingly simple) code. Here's what I have:
Here is some simple code that takes the id values of .somedivs and puts
Can someone please help me fix this code up? I am getting some weird
I am getting some weird distortion of my CCLabelBMFont labels in Cocos2D, as noted
I'm getting some weird differences when running Nokogiri locally versus running it on my
I'm getting some weird things happening when I try to create an AVD or
I'm getting some weird black spots with a custom map page (via the Google
I'm can't figure out some weird behaviour that im getting in the rials console
For some reason, I am getting a weird overlapping dropdown menu glitch. It works
I am getting some weird running times for my mergesort algorithm...I want to run

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.