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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:11:40+00:00 2026-06-05T13:11:40+00:00

Is it possible to tell the difference between 2 ember-date time objects in days?

  • 0

Is it possible to tell the difference between 2 ember-date time objects in days?

For example, if I have the following 2 date objects

var start_date = Ember.DateTime.parse(app.start_date, '%Y-%m-%d');
var end_date = Ember.DateTime.parse(app.end_date, '%Y-%m-%d');

I can tell which one is greater than the other like this:

Ember.DateTime.compareDate(end_date, start_date);

But is there a way of getting the difference in days?

  • 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-05T13:11:43+00:00Added an answer on June 5, 2026 at 1:11 pm

    I am not sure there is an API to get difference in days (something like in JodaTime).
    I know that Ember.DateTime basically extends the regular js Date so you can do something like:

    var date1 = Ember.DateTime.create({ hour: 5, timezone: 300 });
    var date2 = Ember.DateTime.create({ hour: 10, timezone: 0 });
    var timeDiff = Math.abs(date2.getTime() - date1.getTime());
    var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); 
    alert(diffDays)​; 
    

    Hope it helps…

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

Sidebar

Related Questions

I'd like to tell the difference between valid and invalid date objects in JS,
Is it possible to tell the difference between the normal exit of a using
Possible Duplicate: Difference between calling self.var vs var Edit : actually, i did not
Please tell me if it is possible to do the following: create an instance
I was wondering if anyone could tell me (with an example if possible) the
Possible Duplicate: What's the difference between a header file and a library? Can anyone
Possible Duplicate: Is there a performance difference between i++ and ++i in C++? I
Possible Duplicate: Difference between WIN32 and other c string I got this code inside
Possible Duplicate: Difference between -%> and %> in rails So for an ERB file,
Possible Duplicate: very simple delegate musing I've been wondering what's the difference between this

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.