Giter Club home page Giter Club logo

Comments (3)

timdorr avatar timdorr commented on August 22, 2024

ISO8601. Always use this for storage and serialization of your time data.

Grab the timezone from the metadata (unfortunately, this isn't easy) or store it with your definition for an MLS. Take your DateTime and openhouse_time.change(offset: mls_offset) to set the right time zone. Then use it like normal.

from rets.

dougcole avatar dougcole commented on August 22, 2024

Open house times are a pretty odd, most of the ones I've seen come as a string, something like 1pm-3pm which is (usually) in the local time. How we parse this depends on the mls and what they give us, but we end up storing all of them as strings, similar to the sample above. We keep the raw data from the rets server around too, in case we need to reprocess those strings, but the strings can be used directly on the website, not requiring any processing.

I'm not sure this is the best solution, but it's pragmatic and works well for us. This has the downside that we can't search our database for open houses by time, but in practice we've never really needed that and for the majority of mlses we do minimal processing to format the string.

If you do need to search by open house times, normalizing the times and storing in two columns (or a range column if you're in postgresql!) as @timdorr suggests is probably best.

from rets.

summera avatar summera commented on August 22, 2024

Thanks for the info! Much appreciated 😄 . We have settled on a similar approach... storing as is.

If, as you said, there is no need to search by time or show an open house time in a different timezone, then might as well save yourself the complexity and store as is.

@timdorr Unfortunately, you can't rely on an mls offset all the time because the mls may span multiple timezones and, as I recently noticed, the tz offset that an mls may advertise does not correct for DST.

from rets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.