---
title: "Cobol-Date Function (2of 2)"
description: "In Part-1 I have given Date and Time Format in COBOL how we get. Interestingly, there are different date functions in COBOL. Let us see the conversions as below: WS-DATE is any date example format is..."
url: https://srinimf.com/2011/12/04/cobol-date-2/
date: 2011-12-04
modified: 2026-10-05
author: "Srini"
categories: ["COBOL"]
tags: ["cobol", "cobol function", "date time"]
type: post
lang: en
---

# Cobol-Date Function (2of 2)

In [Part-1](http://srinimf.com/2011/12/04/cobol-date-function-1) I have given [Date and Time](https://srinimf.com/2019/01/28/db2-date-sql-queries-to-use-in-your-current-project/) Format in COBOL how we get.

Interestingly, there are different date functions in COBOL. Let us see the conversions as below:

WS-DATE is any date example format is 01/01/0001

- **Convert from Gregorian to Integer formats**

COMPUTE WS-INTEGER-DATE = [FUNCTION INTEGER-OF-DATE](https://srinimf.com/2016/01/14/cobol-date-logic-to-find-number-of-days/) (WS-DATE)

* **Convert from Integer to Gregorian formats**

COMPUTE WS-DATE = FUNCTION DATE-OF-INTEGER (WS-INTEGER-DATE)

*** Convert from Julian to Integer formats**

COMPUTE WS-INTEGER-DATE = FUNCTION INTEGER-OF-DAY (WS-JULIAN-DATE)

*** Convert from Integer to Julian formats**

COMPUTE WS-JULIAN-DATE = FUNCTION DAY-OF-INTEGER (WS-INTEGER-DATE)

I will add some more in my next posts. Bye untill then…

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2011%2F12%2F04%2Fcobol-date-2%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2026%2F02%2Fcropped-logo.png%3Ffit%3D96%252C96%26ssl%3D1&description=Cobol-Date%20Function%20%282of%202%29)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2011/12/04/cobol-date-2/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2011/12/04/cobol-date-2/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2011/12/04/cobol-date-2/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2011/12/04/cobol-date-2/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Cobol-Date%20Function%20%282of%202%29&body=https%3A%2F%2Fsrinimf.com%2F2011%2F12%2F04%2Fcobol-date-2%2F&share=email)
-

### Like this:

Like Loading…
