CHAPTER 2Working with Dates and Times

2.1 Introduction

Using dates correctly is a critical task because many financial calculations require accurate dating. This chapter reviews methods in MATLAB® for handling, converting, and calculating with dates.

Key concepts introduced in this chapter include:

  • The importance of accurate dates and times in finance
  • How MATLAB works with dates and times

Software required for this chapter: MATLAB base program; MATLAB Financial Toolbox™.

2.2 Finance Background: Why Dates and Times Matter

Imagine that you're working in the treasury department of a large company that has just raised $3 billion through a bond sale. A $3 billion bond sold with a 3.5 percent yield incurs an annual interest expense of $105 million. Using a 365-day calendar year, each day's interest expense is $287,671, so accurate date counts to ensure timely interest calculations, payments, and cash flow management are essential. The largest corporate bond sales have exceeded $10 billion so the daily interest expense can approach or exceed $1 million.

Accurate tracking is also important for time-stamped transactions, such as order-processing sequences for trades on securities markets. These markets take time seriously: In April 2016, the Department of Homeland Security and the New York Stock Exchange announced the successful test of a timing information system that was within 30 nanoseconds—that's 30 billionths of a second—of the Coordinated Universal Time (UTC) reference time. ...

Get Foundations of Computational Finance with MATLAB now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.