Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Math in programming is used for calculating commerce-driven applications, dynamic display layout, random activity for gaming interfaces and functionality, as well as in applications that need algebra and trigonometry to govern their functionality. Advanced math requires functions and constant values for equations. The Math class includes functions and constants to assist in math operations. After reading this chapter, you should be comfortable with the Math class methods.
The Date class offers an extensive list of properties and methods for working with the local date and time of a user, as well as time zone and Coordinated Universal Time (UTC) for international users. The class also includes properties and methods for working with date and time comparisons (past, present, and future). This chapter covers getting and displaying the local time of a user and setting a custom date and time. You will also be briefly introduced to UTC and how it can assist you in working with time zones.