Guest User

Untitled

a guest
Jan 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.32 KB | None | 0 0
  1. % '2011-04-05' to date(2011, 4, 5)
  2.  
  3. atom_to_date(Atom, date(Year, Month, Day)):-
  4.     atom_codes(Atom, [Y1, Y2, Y3, Y4, 45, M1, M2, 45, D1, D2]),
  5.     number_codes(Year, [Y1, Y2, Y3, Y4]),
  6.     (M1 = 48 -> number_codes(Month, [M2]) ; number_codes(Month, [M1, M2])),
  7.     (D1 = 48 -> number_codes(Day, [D2]) ; number_codes(Month, [D1, D2])).
Add Comment
Please, Sign In to add comment