DEV Community

Matt Ellen-Tsivintzeli
Matt Ellen-Tsivintzeli

Posted on

1

Sleeps until Christmas: awful answers only

It's that time of year. Some people are counting down sleeps until Christmas day.

I think it would be great if we could help them out with a function or programme of some kind that can help them keep count.

Something that will accept a date and output the number of sleeps until Christmas from that date, or if you don't want to do Christmas, some other date you find important.

One caveat is that the code should, for some reason, get you on Santa's naughty list.

The function should work like so:

sleepsTillChristmas(date) //e.g. 2022-04-15
//output for the example is 264
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay