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 8374873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:01:38+00:00 2026-06-09T15:01:38+00:00

I have 2 lines of code that attempt to place start and end date

  • 0

I have 2 lines of code that attempt to place start and end date times in a JavaScript. new Date('<%= DateTime.now.beginning_of_day.to_s %>') is an example. The DateTime.now.beginning_of_day returns the string 2012-08-13T00:00:00-04:00 which JavaScript translates into 8/13/2012 00:00. Perfect. However, DateTime.yesterday.beginning_of_day.to_s returns ‘2012-08-11 20:00:00-04:00’ which JavaScript translates into 8/11/2012 20:00. I don’t want 8pm the day before yesterday. I want midnight yesterday. I’ve tried Date.yesterday, .in_time_zone("Eastern Time (US & Canada)"), .utc and a myriad of other permutations. What do I have to do to get a date in the past that is formatted in the same manner as DateTime.now?

  • 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-09T15:01:39+00:00Added an answer on June 9, 2026 at 3:01 pm

    Try this:

    DateTime.now.yesterday.beginning_of_day
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have these lines of javascript code that I need to remove all
Basic question here - I have many lines of code that look something like:
I have the following 4 lines of code that I keep reusing in my
We have a very complex Oracle package here (over 4,100 lines of code) that's
this is just a couple of lines of code that i have in my
I have some code in a python string that contains extraneous empty lines. I
I have a chart (code to replicate will be below) that has two lines
I have a line of code that counts all attribute names that end in
I have a line of code that gets the following error when run through
Suppose I have a line of code that starts like the following: Func1(Func2(Func3 Is

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.