Skip to content

Commit

Permalink
hack: fix timezone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ckuijjer committed Dec 13, 2023
1 parent 3979965 commit d6fe039
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cloud/scrapers/cinecenter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Xray from 'x-ray'
import { DateTime } from 'luxon'

import { Screening } from '../types'
import { logger as parentLogger } from '../powertools'
Expand Down Expand Up @@ -41,7 +42,11 @@ const extractFromMoviePage = async ({ url }: { url: string }) => {
title: cleanTitle(movie.title),
url,
cinema: 'Cinecenter',
date: new Date(showing * 1000),
date: DateTime.fromMillis(showing * 1000, { zone: 'utc' })
// the `showing` is in ms Amsterdam time, this way I try to hack the time back to UTC
// wonder however if this is correct for times where it's close to midnight (and crosses a day boundary)
.setZone('Europe/Amsterdam', { keepLocalTime: true })
.toUTC(),
}))

logger.info('extracting done', { url, result })
Expand Down

0 comments on commit d6fe039

Please sign in to comment.