Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop1 Date/Time/Number Formatting Alan Liu Globalization Center of Competency IBM Emerging Technology.

Slides:



Advertisements
Similar presentations
Advanced i-CAM WordWrite Abigail Day. Agenda Creating new forms from existing i-CAM forms –Using i-CAM forms as templates for custom forms –Formatting.
Advertisements

Server-Side Scripting with JSP (2) ISYS 350. Post Back A postback is call to the same page that the form is on. In other words, the contents of the form.
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Lecture 4: Simulation Control, Location, and Weather Input Material prepared by GARD Analytics, Inc. and University of Illinois at Urbana-Champaign under.
Week 5 IBS 520. ColdFusion Variables CF uses variables to store data in memory. There are many different types of variables; each has its own.
Display a 12-Month Calendar CS-2301 D-term Programming Assignment #2 12-Month Calendar CS-2301 System Programming C-term 2009 (Slides include materials.
Foundation Data Workshop
Employee Central Presentation
COMPSCI 125 Spring 2005 ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3: IO *Standard Output *Formatting Decimal.
15 September How Computers Work: Other Forms of Data.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY WEEK WEEK WEEK WEEK WEEK CALENDAR PROJECT.
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Unity Connection 7.0 Directory Integration TOI Manoj Agrawal
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Oracle9 i Datetime Functions Fresher Learning Program January, 2012.
JavaScript Events and Event Handlers 1 An event is an action that occurs within a Web browser or Web document. An event handler is a statement that tells.
San José, CA – September, 2004 Localizing with XLIFF and ICU Markus Scherer Raghuram (Ram) Viswanadha IBM San.
Creating a Simple Page: HTML Overview
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
1 Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
Using Object-Oriented JavaScript CST 200- JavaScript 4 –
119th International Unicode ConferenceSan Jose, California, September 2001 An Overview of ICU Helena Shih Chapman Doug Felt
Server-Side Scripting with JSP (2) ISYS 350. Java Array Examples of declaring an array: – int[] anArray = new int[10]; 10 elements index from 0 to 9 –
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Includes and Dates.
U:/msu/course/cse/103 Day 10, Slide 1 CSE 103 Students: Your BTs have been graded. See Erica or Jo with questions or stay.
The Web Wizard’s Guide To JavaScript Chapter 6 Working with Dates and Times.
VCE IT Theory Slideshows By Mark Kelly vceit.com Data Types 1 a.
HTML,DHTML & Javascript/Session1/1 of 39 Introduction and Basic Tags Session 1 of Using HTML, DHTML & JavaScript.
Getting Started with ICU
Chapter 14 Internationalization F Processing Date and Time –Locale –Date –TimeZone –Calendar and GregorianCalendar –DateFormat and SimpleDateFormat F Formatting.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 26 Internationalization.
Chapter 12: Internationalization Processing Date and Time Processing Date and Time  Locale  Date  TimeZone  Calendar and GregorianCalendar  DateFormat.
26th Internationalization and Unicode ConferenceSan Jose, September 2004 Getting Started with ICU Vladimir Weinstein Eric Mader.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 14 Globalization Support in the Database.
Chapter 14 Internationalization F Processing Date and Time –Locale –Date –TimeZone –Calendar and GregorianCalendar –DateFormat and SimpleDateFormat F Formatting.
Week 7 Lecture 2 Globalization Support in the Database.
Server-Side Scripting with JSP (2) ISYS 350. Java Array Examples of declaring an array: – int[] anArray = new int[10]; 10 elements index from 0 to 9 –
® IBM Software Group © 2006 IBM Corporation Using JSF Mini-Calendar Controls This section describes how to use a JSF Mini-Calendar Control with EGL It.
ECA 225 Applied Interactive Programming ECA 225 Applied Online Programming javascript dates.
Differences Training BAAN IVc-BaanERP 5.0c: Application Administration, Customization and Exchange BaanERP 5.0c Tools / Exchange.
Object Oriented Programming (OOP) LAB # 1 TA. Maram & TA. Mubaraka TA. Kholood & TA. Aamal.
1 Chapter 20 Internationalization. 2 Objectives F To describe Java's internationalization features (§ 20.1). F To construct a locale with language, country,
Java Util Package Prepared by, S.Amudha AP/SWE. Calendar 1.The abstract Calendar class provides a set of methods that allows you to convert a time in.
5 Copyright © 2004, Oracle. All rights reserved. Managing Data in Different Time Zones.
Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop1 Transformation Support Alan Liu Globalization Center of Competency IBM Emerging Technology.
San Jose, California September 2002 What is ICU? Roadmap and Myths Helena Shih Chapman ICU Development Manager IBM Globalization Center of Competency.
VCE IT Theory Slideshows By Mark Kelly vceit.com Version 2 – updated for 2016 Data Types 1 a.
Cupertino, CA, USA / September, 2000First ICU Developer Workshop1 ICU Low-level Utilities and Resource Management Vladimir Weinstein Globalization Center.
Announcements Assignment 1 due Wednesday at 11:59PM Quiz 1 on Thursday 1.
Slide 1 PHP Predefined Functions ITWA113. Murach’s ASP.NET 3.5/C#, C1© 2008, Mike Murach & Associates, Inc. Slide 2 PHP Predefined Functions Objectives.
Working with Date and Time ISYS 475. How PHP processes date and time? Traditional way: – Timestamp Newer and object oriented way: – DateTime class.
CONFIDENTIAL1 Good Afternoon! Today we will be learning about Calendar and Years Let’s warm up : Complete the conversion tables: Hours478 Minutes 1) Calculate.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED ADDING DETAILS TO PROCESS MODEL.
Working with Date ISYS 350.
Guam PDT MST EDT UTC/ GMT
Chapter 14 Internationalization
Phonegap Bridge – Globalization
Java String and Date ISYS 350.
Time Revision.
Java Date ISYS 350.
Logo Calendar – January 2012 TO DO LIST 01/04/2012 Example TO DO LIST
Java Date ISYS 350.
Chapter 35 Internationalization
Phonegap Bridge – Globalization
Events (start and stop and duration)
More to Learn Viewing file details
Java Date ISYS 350.
Java Date ISYS 350.
Presentation transcript:

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop1 Date/Time/Number Formatting Alan Liu Globalization Center of Competency IBM Emerging Technology Center

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop2 Overview

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop3 The Problem Display a date in different languages –English:Friday, June 4, 1999 –German:Freitag, 4. Juni 1999 –French:vendredi 4 juin 1999

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop4 The Problem Display a date in different languages Convert a time between local time zones –Los Angeles:June 3, :00 PM PDT –New York:June 3, :00 PM EDT –Paris:June 4, :00 AM CEST

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop5 The Problem Display a date in different languages Convert a time between local time zones Handle daylight savings time –Sat. Oct. 28, :00 PM PDT + 24 hours = –Sun. Oct. 29, :00 PM PST

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop6 The Problem These problems boil down to: –Formatting –Parsing –Data conversion These operations apply to different data types: –Dates and times –Numbers, including currency amounts –Messages

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop7 Formatting and Parsing Formatting = conversion of binary data to text Parsing = conversion of text to binary data Different locales use different text to represent the same piece of binary data

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop8 Data Conversion In different locales, not only the form but also the value of displayed data may change Reflects different local conventions: time zone, definition of the week, calendar Applies only to dates and times

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop9 Data Conversion Displayed data values differ depending on the locale Underlying binary data does not change Displayed data: Calendar fields Underlying data: UDate scalar

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop10 Data Conversion Conversion happens implicitly during formatting and parsing Conversion can also be done explicitly

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop11 Date and Time

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop12 Date and Time Date and time stored together as a scalar Resolution of 1 millisecond Range roughly 70,000 BC to 70,000 AD Stored as absolute time independent of local time zones (GMT-based)

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop13 Date and Time Extensible calendar system Rule-based time zones with built-in data for all modern international zones (over 400) Rule-based date format with built-in data for many locales (over 140)

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop14 Date and Time Components UDate : GMT-based date and time (ms) Calendar : Convert UDate to/from fields TimeZone : Convert GMT to/from local zone DateFormat : Convert UDate to/from text

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop15 Date and Time Components Fit together in a specific nested pattern DateFormat Calendar TimeZone

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop16 Date and Time Components Fit together in a specific nested pattern 1)Create TimeZone object zone Calendar object cal DateFormat object fmt 2)Set cal’s time zone to zone 3)Set fmt’s calendar to cal

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop17 Date and Time Components If components are not nested explicitly, then they use default objects, which can lead to errors DateFormat uses a default Calendar Calendar uses a default TimeZone

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop18 Calendar : Two Roles Always set to a specific UDate Converts UDate to/from fields –Fields are integer values for the month, day, year, hour, minutes, day of week, etc. –See calendar.h for complete field list

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop19 Detail: Calendar Fields Conversion of fields to UDate cal.clear(); cal.set(YEAR, 1999); cal.set(MONTH, JUNE); cal.set(DAY_OF_WEEK, MONDAY); cal.set(WEEK_OF_MONTH, 2); UDate d = cal.getTime();

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop20 Detail: Calendar Fields Conversion of UDate to fields cal.setTime(myUDate); int32_t month = cal.get(MONTH);

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop21 Time Zones Standard Olson (UNIX) time zone data Over 400 international time zones Does not rely on host OS No historical time zone support Time zones always used with calendars

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop22 Formatters: Code + Patterns Code contains generic pattern engine Locale resources contain different patterns –Different groups of patterns for different locales –Within each group, different patterns for different variants; e.g., one for “Wed 6 Sep 00” and another for “Wednesday 7 September 2000”

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop23 Formatter: Types DateFormat already discussed NumberFormat handles “$1,234.56” MessageFormat handles “3 Files Found” ChoiceFormat handles “no files”/“one file”

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop24 Formatters: Pattern Syntax Each formatter supports its own pattern syntax For number and date formats, most users can use locale data For message format, users will have to write their own patterns See headers for pattern syntax documentation

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop25 Future Directions Support for time zone aliasing Support for traditional calendar systems Support for rule-based number formatting (e.g., “three hundred and sixty-four”)

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop26 Exercises Exercise 1 – datefmt –Use DateFormat to format a date and time into several localized strings –Convert the date and time into local time zones

Cupertino, CA, USA / September, 2000First ICU DeveloperWorkshop27 Exercises Exercise 2 – msgfmt –Use MessageFormat to format a number and date –Use a ChoiceFormat pattern to format the number idiomatically