\[ % MathJax has no bm package; redefine \bm in terms of \boldsymbol, which it supports natively \newcommand{\bm}[1]{\boldsymbol{#1}} % --- Operators ----------------------------------------------------------- % Expectation operator \DeclareMathOperator{\E}{E} % Variance operator \DeclareMathOperator{\Var}{Var} % Covariance operator \DeclareMathOperator{\Cov}{Cov} % Correlation operator \DeclareMathOperator{\Corr}{Corr} % Rank operator (Spearman rank correlation) \DeclareMathOperator{\Rank}{Rank} % Skewness operator \DeclareMathOperator{\Skewness}{Skewness} % Kurtosis operator \DeclareMathOperator{\Kurtosis}{Kurtosis} % Difference/differential operator (upright d per ISO 80000-2) \newcommand{\Diff}{\mathrm{d}} % --- Risk Measures ------------------------------------------------------- % Value at Risk \DeclareMathOperator{\VaR}{VaR} % Expected Shortfall \DeclareMathOperator{\ES}{ES} % Marginal Value at Risk \DeclareMathOperator{\MVaR}{MVaR} % Component Value at Risk \DeclareMathOperator{\CompVaR}{CVaR} % Incremental Value at Risk \DeclareMathOperator{\IVaR}{IVaR} % Component Expected Shortfall \DeclareMathOperator{\CompES}{CES} % Weighted sensitivity for risk factor in FRTB SBM bucket \DeclareMathOperator{\WS}{WS} % Hedge-benefit ratio for FRTB DRC bucket \DeclareMathOperator{\HBR}{HBR} % Stress scenario risk measure for FRTB NMRF capital add-on \DeclareMathOperator{\SES}{SES} % Jump-to-default exposure for obligor (FRTB DRC) \DeclareMathOperator{\JTD}{JTD} % Loss given default for obligor (FRTB DRC) \DeclareMathOperator{\LGD}{LGD} % Default risk weight for obligor (FRTB DRC) \DeclareMathOperator{\RW}{RW} % ES ratio function \newcommand{\ESratio}{\lambda} % Arbitrary risk measure function (coherence axioms) \newcommand{\RiskMeasure}{\varphi} % Asset position (coherence axioms) \newcommand{\Asset}{A} % First named asset in examples \newcommand{\AssetA}{A} % Second named asset in examples \newcommand{\AssetB}{B} % Third named asset in examples \newcommand{\AssetC}{C} % Constant (risk measure axioms) \newcommand{\Constant}{c} % Bucket-level aggregate sensitivity in FRTB SBM \newcommand{\BucketAgg}{S} % Cross-bucket correlation in FRTB SBM \newcommand{\CrossBucketCorr}{\gamma} % Notional amount for an instrument (FRTB DRC and RRAO) \newcommand{\Notional}{\text{Notional}} % --- Distributions ------------------------------------------------------- % Binomial distribution \DeclareMathOperator{\Binomial}{Binomial} % Uniform distribution \DeclareMathOperator{\Uniform}{Uniform} % Normal distribution \newcommand{\NormalDist}{\mathcal{N}} % Student-t CDF \newcommand{\StudentCDF}{t} % Student-t PDF \newcommand{\StudentPDF}{f} % --- Returns ------------------------------------------------------------- % Price \newcommand{\Price}{P} % Simple (arithmetic) return \newcommand{\SimpleReturns}{R} % Log (compound) return \newcommand{\CompoundReturns}{y} % Matrix of compound returns \newcommand{\ReturnMatrix}{\bm{y}} % Dividend payment \newcommand{\dividend}{d} % --- Volatility ---------------------------------------------------------- % Realised variance \DeclareMathOperator{\RealisedVar}{RV} % Realised volatility (square root of realised variance) \DeclareMathOperator{\RealisedVol}{RVol} % Volatility \newcommand{\Vol}{\sigma} % GARCH intercept parameter \newcommand{\GARCHconst}{\omega} % ARCH coefficient (weight on past squared returns) \newcommand{\ARCHcoeff}{\alpha} % GARCH coefficient (weight on past variance) \newcommand{\GARCHcoeff}{\beta} % EWMA decay factor (typically 0.94) \newcommand{\EWMAdecay}{\lambda} % Standardized residual / error term \newcommand{\StdNormal}{\epsilon} % Leverage parameter in apARCH \newcommand{\APARCHleverage}{\zeta} % Power parameter in apARCH \newcommand{\APARCHpower}{\delta} % Degrees of freedom (Student-t) \newcommand{\DOF}{\nu} % GJR-GARCH leverage parameter \newcommand{\GJRleverage}{\gamma} % GARCH-X external regressor coefficient \newcommand{\RegressorCoeff}{\xi} % Mean (first moment) \newcommand{\Mean}{\mu} % Lag order in volatility models \newcommand{\Lag}{L} % Dummy variable (indicator in regressions) \newcommand{\DummyVar}{D} % --- Portfolio ----------------------------------------------------------- % Portfolio weight (scalar) \newcommand{\weight}{w} % Portfolio weight vector \newcommand{\weights}{\bm{w}} % Covariance matrix \newcommand{\CovMatrix}{\bm{\Sigma}} % Correlation matrix \newcommand{\CorrMatrix}{\bm{C}} % Correlation coefficient \newcommand{\correlation}{\rho} % Number of assets in portfolio \newcommand{\NumberAssets}{K} % Portfolio value \newcommand{\PortfolioValue}{\vartheta} % Asset beta (CAPM) \newcommand{\AssetBeta}{\beta} % Ledoit-Wolf shrinkage intensity \newcommand{\ShrinkageIntensity}{\delta} % Sample covariance matrix \newcommand{\SampleCov}{\bm{S}} % --- Time Series --------------------------------------------------------- % Sample size \newcommand{\SampleSize}{T} % Generic count (number of lags, payments, etc.) \newcommand{\Count}{N} % Estimation window length \newcommand{\EstWindow}{W_E} % Testing window length \newcommand{\TestWindow}{W_T} % Stress window length \newcommand{\StressWindow}{W_S} % AR coefficient \newcommand{\ARcoeff}{\phi} % MA coefficient \newcommand{\MAcoeff}{\psi} % --- Probability --------------------------------------------------------- % Probability level (e.g. 0.01 for 1% VaR) \newcommand{\probability}{p} % Cumulative sorted scenario weight \newcommand{\CumScenarioWeight}{\Omega} % p-quantile of the P and L distribution \newcommand{\Quantile}{q} % Quantile function \newcommand{\QuantileFunction}{Q} % Probability density function \newcommand{\PDF}{f} % Cumulative distribution function \newcommand{\CDF}{F} % Standard normal CDF \newcommand{\NormalCDF}{\Phi} % Inverse standard normal (quantile function) \newcommand{\NormalQuantile}{\Phi^{-1}} % Standard normal density function \newcommand{\NormalPDF}{\phi} % Likelihood function \newcommand{\lik}{\mathcal{L}} % Log-likelihood \newcommand{\LogLikelihood}{\ell} % Parameter vector (MLE estimation) \newcommand{\ParamSet}{\theta} % Parameter space \newcommand{\ParamSpace}{\Theta} % Fisher information matrix \newcommand{\FisherInfo}{\mathcal{I}} % Statistical power (Type II error rate) \newcommand{\StatPower}{\beta} % Significance level (CI coverage complement) \newcommand{\SignifLevel}{\gamma} % --- Options ------------------------------------------------------------- % Call option label \newcommand{\CallOption}{\text{call}} % Put option label \newcommand{\PutOption}{\text{put}} % Strike price \newcommand{\Strike}{X} % Risk-free interest rate \newcommand{\RiskFree}{r_f} % Option maturity (time to expiration) \newcommand{\OptionMaturity}{\tau} % Option delta \newcommand{\OptionDelta}{\Delta} % Option gamma \newcommand{\OptionGamma}{\Gamma} % Option vega \newcommand{\Vega}{\mathcal{V}} % Holding period \newcommand{\HoldingPeriod}{H} % Simulation profit/loss (signed; negative is a loss) \newcommand{\ProfitLoss}{\Pi} % Futures price \newcommand{\Futures}{F} % Hedge ratio \newcommand{\HedgeRatio}{h} % Units of basic asset held \newcommand{\StockHolding}{x^b} % Units of options held \newcommand{\OptionHolding}{x^o} % --- Interest Rates ------------------------------------------------------ % Bond convexity \newcommand{\Convexity}{C} % Interest rate / yield \newcommand{\Yields}{r} % Key rate change, basis points (scalar tenor component); used as \KeyRateChange_k or \KeyRateChange_{t,k}. EXCEPTION to the no-macro-to-macro-indirection rule, decided 2026-08-09: composed from \Yields on purpose, so a future change to the rate glyph propagates here without a follow-up edit. \Yields is defined earlier in generated output (same interest_rates category, TOML order), so expansion order is safe; verify this still holds if either entry is reordered. \newcommand{\KeyRateChange}{\Delta \Yields^{\mathrm{bp}}} % Key rate changes, basis points (vector); used bare or as \KeyRateChanges_t. EXCEPTION to the no-macro-to-macro-indirection rule, decided 2026-08-09: composed from \Yields on purpose, so a future change to the rate glyph propagates here without a follow-up edit. \bm{\Yields} depends on \bm/\boldsymbol correctly expanding a macro argument rather than a bare letter --- confirm this renders correctly the first time either consumer compiles it. \newcommand{\KeyRateChanges}{\Delta \bm{\Yields}^{\mathrm{bp}}} % Dollar value of a basis point \newcommand{\DV}{\text{DV01}} % Mean reversion speed (interest rate models) \newcommand{\MeanReversion}{\varkappa} % Modified duration \newcommand{\ModDur}{D} % Macaulay duration \newcommand{\MacDur}{D_{\text{Mac}}} % Effective duration \newcommand{\EffDur}{D_{\text{eff}}} % DV01 vector \newcommand{\DVvec}{\bm{d}} % Long-run mean rate (Vasicek/CIR/Hull-White) \newcommand{\LongRunRate}{\theta} % Hull-White time-varying drift \newcommand{\HullWhiteDrift}{\varphi} % Cash flow (coupon/principal payment) \newcommand{\CashFlow}{c} % --- Extreme Value ------------------------------------------------------- % Tail index (EVT, Pareto-type tails) \newcommand{\TailIndex}{\iota} % Shape parameter (xi = 1/iota) \newcommand{\ShapeParam}{\varsigma} % Threshold value (EVT) \newcommand{\Threshold}{u} % Extremal index (Leadbetter 1983) \newcommand{\ExtremalIndex}{\theta} % Multivariate extremal coefficient, theta in [1,d]. theta=1 complete tail dependence; theta=d asymptotic independence. Glyph collides with ExtremalIndex and ParamSet; disambiguated at source by macro name. \newcommand{\ExtremalCoef}{\theta} % GEV distribution function \newcommand{\GEV}{\mathcal{H}} % GPD distribution function \newcommand{\GPD}{\mathcal{G}} % GPD scale parameter \newcommand{\GPDscale}{\beta} % GPD scale parameter at a threshold u, distinct from the generic GPD scale \newcommand{\GPDscaleAtThreshold}{\beta_u} % Number of threshold exceedances (EVT) \newcommand{\TailCount}{C} % Sample maximum (block maxima, EVT) \newcommand{\SampleMax}{M} % Kurtosis value (realized, e.g. sample kurtosis) \newcommand{\KurtosisVal}{\kappa} % Pareto scaling constant (EVT) \newcommand{\ParetoConst}{\mathcal{A}} % Generic constant (EVT asymptotics) \newcommand{\RemainderConst}{\mathcal{C}} % Little-o asymptotic notation \newcommand{\LittleO}{o} % Moment order (EVT) \newcommand{\MomentOrder}{\mathscr{m}} % Doubled sample size (EVT block maxima) \newcommand{\DoubleSample}{D} % GEV normalizing location constant \newcommand{\GEVloc}{a} % GEV normalizing scale constant \newcommand{\GEVscale}{b} % Negative return (loss, EVT context) \newcommand{\NegativeReturn}{L} % --- Copulas ------------------------------------------------------------- % Copula function \newcommand{\Copula}{\mathcal{C}} % Copula density \newcommand{\CopulaDensity}{c} % Generator function (Archimedean copulas) \newcommand{\generator}{\varphi} % Copula dependence parameter \newcommand{\CopulaParam}{\theta} % Copula marginal parameter set \newcommand{\MarginalParamSet}{\eta} % Lower tail dependence coefficient \newcommand{\LowerTailDep}{\lambda_L} % Upper tail dependence coefficient \newcommand{\UpperTailDep}{\lambda_U} % Marginal CDF (second variable) \newcommand{\MarginalCDF}{G} % Joint density function \newcommand{\JointDensity}{h} % Marginal density function \newcommand{\MarginalDensity}{g} % Joint distribution function \newcommand{\JointCDF}{H} % Gaussian copula correlation parameter \newcommand{\CopulaCorr}{\rho} % --- Multivariate -------------------------------------------------------- % Diagonal matrix of conditional volatilities \newcommand{\DiagVolD}{\bm{D}} % Idiosyncratic variance matrix (diagonal, factor models) \newcommand{\IdioVarMatrix}{\bm{\Psi}} % Covariance matrix entry (two indices) \newcommand{\CovElement}{\sigma} % Auxiliary matrix in DCC dynamics \newcommand{\DCCauxQ}{\bm{Q}} % BEKK constant matrix \newcommand{\BEKKconst}{\bm{\Omega}} % BEKK ARCH parameter matrix \newcommand{\BEKKarch}{\bm{A}} % BEKK GARCH parameter matrix \newcommand{\BEKKgarch}{\bm{B}} % DCC rescaling diagonal matrix \newcommand{\DCCrescaleZ}{\bm{Z}} % DCC auxiliary matrix element \newcommand{\DCCelement}{q} % Factor loadings matrix (loadings/eigenvectors of the covariance matrix) \newcommand{\FactorLoadings}{\bm{\Lambda}} % Factor subscript label \newcommand{\factor}{\text{factor}} % PCA eigenvalue \newcommand{\Eigenvalue}{\lambda} % Number of factors in factor model \newcommand{\NumberFactors}{m} % Factor return vector \newcommand{\FactorReturn}{\bm{g}} % PCA factor score (scalar; not an eigenvector) \newcommand{\PCAFactor}{F} % BEKK cross-covariance coefficient \newcommand{\BEKKcross}{\delta} % Factor loading element \newcommand{\FactorLoading}{\Lambda} % DCC correlation persistence parameter \newcommand{\DCCxi}{\xi} % DCC news coefficient (weight on recent shocks) \newcommand{\DCCzeta}{\zeta} % --- Simulation ---------------------------------------------------------- % Number of simulation paths \newcommand{\NumberSims}{B} % Cholesky factor of covariance matrix \newcommand{\Cholesky}{\bm{L}} % Uniform random number \newcommand{\UniformDraw}{\tilde{u}} % --- Backtesting --------------------------------------------------------- % Violation ratio (observed/expected violations) \DeclareMathOperator{\ViolRatio}{VR} % Stressed Value at Risk \DeclareMathOperator{\StressedVaR}{SVaR} % QLIKE loss function for variance forecasts \DeclareMathOperator{\QLIKE}{QLIKE} % Mean squared error (forecast loss function) \DeclareMathOperator{\MSE}{MSE} % Mean absolute error (forecast loss function) \DeclareMathOperator{\MAE}{MAE} % Markov transition probability \newcommand{\TransProb}{\pi} % Exception indicator: 1 if y_t < -VaR_t \newcommand{\ExceptionInd}{\eta} % Exception count \newcommand{\ExceptionCount}{\upsilon} % Probability Integral Transform \newcommand{\ProbIntegralTransform}{\hat{u}} % Quantile score (pinball loss function) \newcommand{\QuantileScore}{\mathcal{S}} % Kolmogorov-Smirnov test statistic \newcommand{\KSstat}{D} % Test statistic (generic base letter) \newcommand{\TestStat}{J} % --- General ------------------------------------------------------------- % Regression intercept \newcommand{\RegressionIntercept}{a} % Regression slope \newcommand{\RegressionSlope}{\beta} % Risk factor \newcommand{\RiskFactor}{x} % Forecast horizon \newcommand{\ForecastHorizon}{h} % Block length (bootstrap) \newcommand{\BlockLength}{\ell} % Capital tau variant \newcommand{\DeliveryTime}{\Upsilon} % Today's calendar time in years (option pricing input; distinct from trading-date index t) \newcommand{\CalendarTime}{t^*} % Probability measure \newcommand{\ProbMeasure}{\mathbb{P}} % Risk-neutral measure \newcommand{\RiskNeutral}{\mathbb{Q}} % Pricing function (Black-Scholes, bond pricing, etc.) \newcommand{\PricingFn}{V} % Indicator function \newcommand{\Indicator}{\bm{1}} % Vector of ones \newcommand{\OnesVector}{\bm{1}} % Risk factor sensitivity (first-order P&L) \newcommand{\Sensitivity}{\delta} % Second-order sensitivity (convexity/gamma) \newcommand{\ConvexitySens}{\gamma} % Output floor percentage (Basel) \newcommand{\OutputFloor}{\alpha} % --- Subscript Labels ---------------------------------------------------- % Subscript label: annualized \newcommand{\Annual}{a} % Subscript label: implied \newcommand{\Implied}{I} % Subscript label: portfolio \newcommand{\Portfolio}{\pi} % --- Text Abbreviations -------------------------------------------- % S&P 500 index \newcommand{\SP}{\text{S\&P-500}} % Student-t distribution (text) \newcommand{\St}{\text{Student-t}} % Geopolitical Risk index (Caldara and Iacoviello) \newcommand{\GPR}{\text{GPR}} \]

5  Dates and times

Market data comes with timestamps that must be parsed, synchronised across time zones and stored consistently. Financial markets operate across different time zones with varying holiday schedules, making date management more complex than in many other domains. Getting date formats, time zones and software representations wrong will misalign data and corrupt results.

5.1 Data and libraries

Date handling needs a parsing library in each language and nothing else.

library(lubridate)
from datetime import datetime, timezone
from zoneinfo import ZoneInfo
using Dates, TimeZones

5.2 Common date formats

A date can be written numerically in several ways. Consider the date 13 September 2018:

Format Example
DD-MM-YYYY 13-09-2018
MM-DD-YYYY 09-13-2018
YYYY-MM-DD 2018-09-13
YYYYMMDD 20180913

The best way is to use the YYYYMMDD convention for two reasons:

  1. It can be represented as an integer, not as a string, making data handling more convenient;
  2. It sorts naturally (in chronological order).

For international data, use the ISO 8601 format YYYY-MM-DDTHH:MM:SSZ, where T separates date and time and Z indicates UTC. For example, 2025-02-10T14:30:00Z represents 10 February 2025, at 14:30 UTC.

5.3 Time zones and UTC

UTC (Coordinated Universal Time) is the primary global time standard. Financial data is often timestamped in UTC to avoid confusion across different market hours and locations.

Major financial markets operate in different time zones — New York (EST/EDT), London (GMT/BST), Tokyo (JST) and Hong Kong (HKT). Market opening and closing times must be converted to a common reference, typically UTC, for analysis across multiple markets.

Summer time changes complicate time zone handling. The US and Europe change clocks on different dates, creating periods where the time difference between New York and London varies. For example, there are brief periods when New York is 4 hours behind London instead of the usual 5 hours.

Convert all timestamps to UTC before you calculate anything on an international portfolio. This ensures that events are properly sequenced and that correlations between markets are not distorted by time zone misalignments. Many data providers offer timestamps in both local market time and UTC.

UTC and GMT (Greenwich Mean Time) are often used interchangeably, though technically UTC includes leap seconds to stay aligned with Earth’s rotation, which GMT does not. For practical financial analysis, this distinction rarely matters.

All three languages provide functions for time zone conversions, but you should verify historical dates around summer time changes manually.

5.4 How software handles dates

Software does not store dates as calendars. It stores them as numeric offsets from an epoch.

The Unix epoch (1 January 1970, 00:00:00 UTC) is the starting point for timekeeping in Unix-like systems, like Mac and Linux. Time is measured as the number of seconds elapsed since this moment, known as Unix time. For example, Unix timestamp 1740301494 corresponds to 2025-02-23T09:04:54Z.

Historical dates before 1970 use negative numbers. For instance, 1 July 1850 at noon UTC is -3771144000.

Windows file timestamps (FILETIME) count from 1 January 1601, 00:00:00 UTC and cannot represent earlier dates, which can cause compatibility issues when transferring data between systems.

Dates break most often when data moves between programs. Excel’s date origin is a workbook setting, not a property of the version — the origin year can be either 1900 or 1904, historically defaulting to 1904 on Mac — so verify it before use. Excel does not allow dates before 1900.

5.5 Parsing dates in financial data

Financial data often arrives with inconsistent date formats from different sources. All three languages provide tools for handling these variations and converting between formats commonly used in finance.

Common date format patterns:

  • Year-month-day (2024-02-15) — ISO standard, common in databases
  • Month-day-year (02/15/2024) — US convention, often in US data feeds
  • Day-month-year (15/02/2024) — European convention, UK data sources
date1 = dmy("21-02-2024")
date2 = mdy("02/21/2024")
date3 = ymd_hms("2024-02-21 14:30:00", tz = "UTC")
print(date1)
print(date2)
print(format(date3, "%Y-%m-%d %H:%M:%S"))
unix_time = 1708525800
date_time = as_datetime(unix_time, tz = "UTC")
print(format(date_time, "%Y-%m-%d %H:%M:%S"))
[1] "2024-02-21"
[1] "2024-02-21"
[1] "2024-02-21 14:30:00"
[1] "2024-02-21 14:30:00"
from datetime import datetime, timezone

date1 = datetime.strptime("21-02-2024", "%d-%m-%Y").date()
date2 = datetime.strptime("02/21/2024", "%m/%d/%Y").date()
date3 = datetime.strptime("2024-02-21 14:30:00", "%Y-%m-%d %H:%M:%S")
print(date1)
print(date2)
print(date3.strftime("%Y-%m-%d %H:%M:%S"))
unix_time = 1708525800
date_time = datetime.fromtimestamp(unix_time, tz=timezone.utc)
print(date_time.strftime("%Y-%m-%d %H:%M:%S"))
2024-02-21
2024-02-21
2024-02-21 14:30:00
2024-02-21 14:30:00
using Dates
date1 = Date("21-02-2024", DateFormat("dd-mm-yyyy"))
date2 = Date("02/21/2024", DateFormat("mm/dd/yyyy"))
date3 = DateTime("2024-02-21 14:30:00", DateFormat("yyyy-mm-dd HH:MM:SS"))
println(date1)
println(date2)
println(Dates.format(date3, "yyyy-mm-dd HH:MM:SS"))
unix_time = 1708525800
date_time = unix2datetime(unix_time)
println(Dates.format(date_time, "yyyy-mm-dd HH:MM:SS"))
2024-02-21
2024-02-21
2024-02-21 14:30:00
2024-02-21 14:30:00

5.6 Converting between time zones

A common task is converting local market times to UTC for cross-market analysis. Suppose the New York Stock Exchange closes at 16:00 Eastern Time and the London Stock Exchange closes at 16:30 London time on 21 June 2024, during summer time. We convert both to UTC.

ny_close = ymd_hms("2024-06-21 16:00:00", tz = "America/New_York")
london_close = ymd_hms("2024-06-21 16:30:00", tz = "Europe/London")
ny_utc = with_tz(ny_close, tzone = "UTC")
london_utc = with_tz(london_close, tzone = "UTC")
print(format(ny_utc, "%Y-%m-%d %H:%M:%S"))
print(format(london_utc, "%Y-%m-%d %H:%M:%S"))
[1] "2024-06-21 20:00:00"
[1] "2024-06-21 15:30:00"
from datetime import datetime
from zoneinfo import ZoneInfo

ny_close = datetime(2024, 6, 21, 16, 0, 0, tzinfo=ZoneInfo("America/New_York"))
london_close = datetime(2024, 6, 21, 16, 30, 0, tzinfo=ZoneInfo("Europe/London"))
ny_utc = ny_close.astimezone(ZoneInfo("UTC"))
london_utc = london_close.astimezone(ZoneInfo("UTC"))
print(ny_utc.strftime("%Y-%m-%d %H:%M:%S"))
print(london_utc.strftime("%Y-%m-%d %H:%M:%S"))
2024-06-21 20:00:00
2024-06-21 15:30:00
using Dates, TimeZones
ny_close = ZonedDateTime(2024, 6, 21, 16, 0, 0, tz"America/New_York")
london_close = ZonedDateTime(2024, 6, 21, 16, 30, 0, tz"Europe/London")
ny_utc = astimezone(ny_close, tz"UTC")
london_utc = astimezone(london_close, tz"UTC")
println(Dates.format(DateTime(ny_utc, UTC), "yyyy-mm-dd HH:MM:SS"))
println(Dates.format(DateTime(london_utc, UTC), "yyyy-mm-dd HH:MM:SS"))
2024-06-21 20:00:00
2024-06-21 15:30:00

5.7 Common date and time issues in financial analysis

When Samoa skipped 30 December 2011, moving directly to 31 December, any financial analysis spanning this period required special handling to avoid gaps in time series data.

Similarly, when Venezuela advanced its clocks by 30 minutes in 2016 with little notice, or when Russia rearranged its time zones in 2014, financial systems had to quickly adjust to maintain accurate timestamps. Morocco’s practice of suspending daylight saving time during Ramadan, with dates announced close to the event, creates ongoing challenges for automated trading systems.

Unusual time zones add complexity to global analysis. Nepal operates on UTC+5:45, one of the few 45-minute offsets in use, while North Korea introduced Pyongyang Time (UTC+8:30) in 2015 before reverting to UTC+9 in 2018. These non-standard offsets require special handling in financial systems designed around hour-based time zones. This is why financial institutions typically standardise on UTC for internal systems.

Market holidays create additional gaps in data series that must be handled appropriately in analysis. Different markets observe different holidays, meaning that correlations calculated during holiday periods may not reflect normal trading relationships.

Daylight saving time transitions can create apparent jumps or gaps in intraday data series. When clocks “spring forward”, an hour disappears, while “falling back” creates a repeated hour that can lead to duplicate timestamps if not handled carefully.

Standardise timestamps before any analysis begins. If one market reports local time and another reports UTC, the data will line up on the screen and mislead in the results.