File: Time.java

package info (click to toggle)
quantlib-swig 1.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,284 kB
  • sloc: python: 6,056; java: 1,552; cs: 774; makefile: 243; sh: 22
file content (24 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package examples;

import org.quantlib.Date;
import org.quantlib.Month;
import java.time.LocalDate;

public class Time {


    public static void main(String[] args) throws Exception {

        Date qlDate = new Date(18, Month.April, 2023);
        LocalDate localDate = LocalDate.of(2023, 4, 18);

        Date qlDateFromLocalDate = Date.of(localDate);
        LocalDate localDateFromQlDate = qlDate.toLocalDate();

        System.out.println("qlDate:              " + qlDate);
        System.out.println("qlDateFromLocalDate: " + qlDateFromLocalDate);
        System.out.println("localDate:           " + localDate);
        System.out.println("localDateFromQlDate: " + localDateFromQlDate);
    }
}